Add possibility to change default tag for update repos
Change-Id: Iac591ba795160695c3105c9678757a93127934cc
diff --git a/src/com/mirantis/system_qa/SharedPipeline.groovy b/src/com/mirantis/system_qa/SharedPipeline.groovy
index b85c507..7704d31 100644
--- a/src/com/mirantis/system_qa/SharedPipeline.groovy
+++ b/src/com/mirantis/system_qa/SharedPipeline.groovy
@@ -165,6 +165,7 @@
def env_ipmi_pass = env.IPMI_PASS ?: ''
def env_lab_mgm_iface = env.LAB_MANAGEMENT_IFACE ?: ''
def env_lab_ctl_iface = env.LAB_CONTROL_IFACE ?: ''
+ def update_repo_custom_tag = env.UPDATE_REPO_CUSTOM_TAG ?: ''
def parameters = [
string(name: 'PARENT_NODE_NAME', value: "${NODE_NAME}"),
string(name: 'PARENT_WORKSPACE', value: pwd()),
@@ -187,6 +188,7 @@
string(name: 'IPMI_PASS', value: env_ipmi_pass),
string(name: 'LAB_MANAGEMENT_IFACE', value: env_lab_mgm_iface),
string(name: 'LAB_CONTROL_IFACE', value: env_lab_ctl_iface),
+ string(name: 'UPDATE_REPO_CUSTOM_TAG', value: "${update_repo_custom_tag}"),
booleanParam(name: 'SHUTDOWN_ENV_ON_TEARDOWN', value: false),
]
@@ -291,6 +293,7 @@
def tcp_qa_refs = env.TCP_QA_REFS ?: ''
def environment_template_ref_change = env.ENVIRONMENT_TEMPLATE_REF_CHANGE ?: ''
def cookiecutter_ref_change = env.COOKIECUTTER_REF_CHANGE ?: ''
+ def update_repo_custom_tag = env.UPDATE_REPO_CUSTOM_TAG ?: ''
def parameters = [
string(name: 'LAB_CONTEXT_NAME', value: "${LAB_CONFIG_NAME}"),
@@ -308,6 +311,7 @@
string(name: 'IPV4_NET_EXTERNAL', value: IPV4_NET_EXTERNAL),
string(name: 'IPMI_USER', value: env.IPMI_USER),
string(name: 'IPMI_PASS', value: env.IPMI_PASS),
+ string(name: 'UPDATE_REPO_CUSTOM_TAG', value: "${update_repo_custom_tag}"),
string(name: 'IMAGE_PATH_CFG01_DAY01', value: env.IMAGE_PATH_CFG01_DAY01),
]
diff --git a/tcp_tests/templates/shared-salt.yaml b/tcp_tests/templates/shared-salt.yaml
index c3bc0f3..c8c56ac 100644
--- a/tcp_tests/templates/shared-salt.yaml
+++ b/tcp_tests/templates/shared-salt.yaml
@@ -34,6 +34,7 @@
{% set UBUNTU_SECURITY_REPOSITORY = os_env('UBUNTU_SECURITY_REPOSITORY', "deb [arch=amd64] http://mirror.mirantis.com/" + REPOSITORY_SUITE + "/ubuntu/ ${DISTRIB_CODENAME}-security main restricted universe") %}
{% set UBUNTU_KEY_SERVER = os_env('UBUNTU_KEY_SERVER', 'keyserver.ubuntu.com') %}
{% set UBUNTU_KEY_ID = os_env('UBUNTU_KEY_ID', '0E08A149DE57BFBE') %}
+{% set UPDATE_REPO_CUSTOM_TAG = os_env('UPDATE_REPO_CUSTOM_TAG', '') %}
{# Address pools for reclass cluster model are taken in the following order:
# 1. environment variables,
@@ -621,6 +622,18 @@
retry: {count: 1, delay: 1}
skip_fail: false
+{%- if UPDATE_REPO_CUSTOM_TAG != '' %}
+- description: "[EXPERIMENTAL] Change update repos tag acording to defined in job"
+ cmd: |
+ . /root/venv-reclass-tools/bin/activate;
+ reclass-tools add-key parameters._param.linux_system_repo_update_url 'http://mirror.mirantis.com/update/{{ UPDATE_REPO_CUSTOM_TAG }}/' /srv/salt/reclass/classes/cluster/{{ CLUSTER_NAME }}/openstack/init.yml;
+ # Replace ubuntu_updates repo tag independently, because it has another url structure
+ reclass-tools add-key parameters.linux.system.repo.ubuntu_updates.source 'deb [arch=amd64] http://mirror.mirantis.com/{{ UPDATE_REPO_CUSTOM_TAG }}/ubuntu/ ${_param:linux_system_codename}-updates main restricted universe' /srv/salt/reclass/classes/cluster/{{ CLUSTER_NAME }}/infra/apt_repos.yml;
+ node_name: {{ HOSTNAME_CFG01 }}
+ retry: {count: 1, delay: 5}
+ skip_fail: false
+{%- endif %}
+
{%- endmacro %}