From c7ab46f620243d6fb0bf86e656007b512dd82bce Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Wed, 20 May 2020 20:14:22 +0300 Subject: [PATCH] Make upgrade jobs get role relevant versions This patch aims to fix upgrade jobs and make them use patched role instead of it's master version. Depends-On: https://review.opendev.org/734888/ Change-Id: Ibbdecaa454a2082cd84365ebc8605e63530f206f --- scripts/gate-check-commit.sh | 6 ++++++ scripts/get-ansible-role-requirements.yml | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/gate-check-commit.sh b/scripts/gate-check-commit.sh index 11772f4d12..77fdc11852 100755 --- a/scripts/gate-check-commit.sh +++ b/scripts/gate-check-commit.sh @@ -213,6 +213,7 @@ if [[ "${ACTION}" == "upgrade" ]]; then unset ANSIBLE_PACKAGE unset UPPER_CONSTRAINTS_FILE unset PIP_OPTS + unset UPGRADE_TARGET_BRANCH load_nodepool_pip_opts @@ -221,6 +222,11 @@ if [[ "${ACTION}" == "upgrade" ]]; then # We need this as in stein we were deploying custom # /etc/openstack_deploy/env.d/aio_metal.yml for metal installs export SKIP_CUSTOM_ENVD_CHECK=true + export DROP_ROLE_DIRS=true + # NOTE(noonedeadpunk): This might be moved to zuul.d/playbooks/run.yaml + export ZUUL_SRC_PATH="/home/zuul/src" + # Doing symlinking here, as bootstrap role won't be called + ln -s $ZUUL_SRC_PATH /openstack/src # To execute the upgrade script we need to provide # an affirmative response to the warning that the # upgrade is irreversable. diff --git a/scripts/get-ansible-role-requirements.yml b/scripts/get-ansible-role-requirements.yml index b253f9ea0b..c4ec79061a 100644 --- a/scripts/get-ansible-role-requirements.yml +++ b/scripts/get-ansible-role-requirements.yml @@ -24,8 +24,8 @@ path: "{{ item.path | default(role_path_default) }}/{{ item.name | default(item.src | basename) }}" state: absent when: - - item.scm == "git" or item.scm is undefined - - "(item.path | default(role_path_default) ~ '/' ~ item.name | default(item.src | basename) ~ '/.git') is not directory" + - ((item.path | default(role_path_default) ~ '/' ~ item.name | default(item.src | basename) ~ '/.git') is not directory) or + (lookup('env', 'DROP_ROLE_DIRS') | bool is true) with_items: "{{ required_roles }}" - name: Ensure the default roles directory exists @@ -95,7 +95,7 @@ when: - "lookup('env', 'ZUUL_SRC_PATH') != ''" - + - "lookup('env', 'UPGRADE_TARGET_BRANCH') == ''" - name: Generate a list of user overridden roles set_fact: user_overridden_roles: "{{ user_roles | json_query('[*].name') }}"