Add deployment steps for model virtual-mcp-ocata-cicd
Change-Id: I55a62a827a9d209821cf69f82b8b0eda58d816f4
Reviewed-on: https://review.gerrithub.io/369227
Reviewed-by: Dennis Dmitriev <dis.xcom@gmail.com>
Tested-by: Dennis Dmitriev <dis.xcom@gmail.com>
diff --git a/tcp_tests/templates/virtual-mcp11-ovs/salt.yaml b/tcp_tests/templates/virtual-mcp11-ovs/salt.yaml
index 73a61a0..0de5e76 100644
--- a/tcp_tests/templates/virtual-mcp11-ovs/salt.yaml
+++ b/tcp_tests/templates/virtual-mcp11-ovs/salt.yaml
@@ -5,6 +5,9 @@
{% set SALT_MODELS_BRANCH = os_env('SALT_MODELS_BRANCH','master') %}
{% set SALT_MODELS_COMMIT = os_env('SALT_MODELS_COMMIT','master') %}
+# Reference to a patch that should be applied to the model if required, for example: export SALT_MODELS_REF_CHANGE=refs/changes/19/7219/12
+{% set SALT_MODELS_REF_CHANGE = os_env('SALT_MODELS_REF_CHANGE', '') %}
+
# Address pools for reclass cluster model are taken in the following order:
# 1. environment variables,
# 2. config.underlay.address_pools based on fuel-devops address pools
@@ -96,7 +99,9 @@
ssh-keyscan -H github.com >> ~/.ssh/known_hosts;
git clone -b {{ SALT_MODELS_BRANCH }} --recurse-submodules {{ SALT_MODELS_REPOSITORY }} /srv/salt/reclass;
pushd /srv/salt/reclass && git checkout {{ SALT_MODELS_COMMIT }} && popd;
-
+ {%- if SALT_MODELS_REF_CHANGE != '' %}
+ pushd /srv/salt/reclass && git fetch {{ SALT_MODELS_REPOSITORY }} {{ SALT_MODELS_REF_CHANGE }} && git checkout FETCH_HEAD && popd;
+ {%- endif %}
mkdir -p /srv/salt/reclass/classes/service;
# Replace firstly to an intermediate value to avoid intersection between