Add ability to specify target commit for environment_template repo
Since we want to use specific branch for specific releases we also
have to use specific branch for environment_template repository.
This could be done via ENVIRONMENT_TEMPLATE_COMMIT environment variable.
Change-Id: I9aa17462f888adfcac41d101fd940f4734dfdb50
diff --git a/tcp_tests/templates/shared-salt.yaml b/tcp_tests/templates/shared-salt.yaml
index dcbf3af..d48fb6a 100644
--- a/tcp_tests/templates/shared-salt.yaml
+++ b/tcp_tests/templates/shared-salt.yaml
@@ -15,6 +15,7 @@
{% set COOKIECUTTER_REF_CHANGE = os_env('COOKIECUTTER_REF_CHANGE','') %}
{% set COOKIECUTTER_TAG = os_env('COOKIECUTTER_TAG','') %}
{% set COOKIECUTTER_TEMPLATE_COMMIT = os_env('COOKIECUTTER_TEMPLATE_COMMIT','') %}
+{% set ENVIRONMENT_TEMPLATE_COMMIT = os_env('ENVIRONMENT_TEMPLATE_COMMIT','') %}
{% set ENVIRONMENT_TEMPLATE_REF_CHANGE = os_env('ENVIRONMENT_TEMPLATE_REF_CHANGE','') %}
# Currently we support 2 salt version that can be set over bellow var
{% set SALT_VERSION = os_env('SALT_VERSION','2017.7') %}
@@ -507,21 +508,20 @@
set -e;
mkdir -p /root/environment/;
export GIT_SSL_NO_VERIFY=true; git clone https://github.com/Mirantis/environment-template /root/environment/environment_template
- node_name: {{ HOSTNAME_CFG01 }}
- skip_fail: false
-{%- if ENVIRONMENT_TEMPLATE_REF_CHANGE != '' %}
-- description: Fetch changes for environment templates
- cmd: |
- set -e;
- set -x;
+ {%- if ENVIRONMENT_TEMPLATE_REF_CHANGE != '' %}
pushd /root/environment/environment_template &&
git fetch https://github.com/Mirantis/environment-template {{ ENVIRONMENT_TEMPLATE_REF_CHANGE }} &&
git checkout FETCH_HEAD &&
popd
+ {%- elif ENVIRONMENT_TEMPLATE_COMMIT != '' %}
+ pushd /root/environment/environment_template
+ git checkout {{ ENVIRONMENT_TEMPLATE_COMMIT }}
+ popd
+ {%- endif %}
+
node_name: {{ HOSTNAME_CFG01 }}
skip_fail: false
-{%- endif %}
{%- for ENVIRONMENT_CONTEXT_NAME in ENVIRONMENT_CONTEXT_NAMES %}
- description: "[EXPERIMENTAL] Upload environment inventory to cfg01.{{ DOMAIN_NAME }}"