From 002c35fbe62202d018482d36da8e28bf5879e510 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Mon, 15 May 2017 16:22:28 +0100 Subject: [PATCH] scripts: sources-branch-updater: Allow role requirements updates on master External users of the library may need to be able to update the ansible-role-requirements file even on master branch so provide this ability using the FORCE_MASTER env variable. Change-Id: I3a969c361fde1e87cd79eed441015b8c88e1ae03 --- scripts/sources-branch-updater-lib.sh | 6 ++++-- scripts/sources-branch-updater.sh | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/sources-branch-updater-lib.sh b/scripts/sources-branch-updater-lib.sh index f3ab26f20b..ee75ce0397 100644 --- a/scripts/sources-branch-updater-lib.sh +++ b/scripts/sources-branch-updater-lib.sh @@ -210,11 +210,13 @@ update_ansible_role_requirements() { local role_name role_version osa_repo_tmp_path role_git_sources current_source_dir local osa_branch=${1} local pre_release=${2} + local force_master=${3} current_source_dir="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)" # Update the ansible-role-requirements.yml file - # We don't want to be doing this for the master branch - if [ "${osa_branch}" != "master" ] || [ "${pre_release}" == "true" ]; then + if [ "${osa_branch}" != "master" ] || \ + [ "${pre_release}" == "true" ] || \ + [ "${force_master}" == "true" ]; then echo "Updating ansible-role-requirements.yml" if [ "${pre_release}" == "true" ]; then diff --git a/scripts/sources-branch-updater.sh b/scripts/sources-branch-updater.sh index bad0a67d28..4c2dcead4c 100755 --- a/scripts/sources-branch-updater.sh +++ b/scripts/sources-branch-updater.sh @@ -24,6 +24,7 @@ OSA_BRANCH=${OSA_BRANCH:-"$OS_BRANCH"} SERVICE_FILE=${SERVICE_FILE:-"playbooks/defaults/repo_packages/openstack_services.yml"} OPENSTACK_SERVICE_LIST=${OPENSTACK_SERVICE_LIST:-"$(grep 'git_repo\:' ${SERVICE_FILE} | awk -F '/' '{ print $NF }' | egrep -v 'requirements|-' | tr '\n' ' ')"} PRE_RELEASE=${PRE_RELEASE:-"false"} +FORCE_MASTER=${FORCE_MASTER:-"false"} source scripts/sources-branch-updater-lib.sh || { echo "Failed to source updater library"; exit 1; } @@ -95,6 +96,6 @@ sync_roles_and_packages ${OS_BRANCH} ${OSA_BRANCH} ${SERVICE_FILE} ${OPENSTACK_S update_pip_options -update_ansible_role_requirements ${OSA_BRANCH} ${PRE_RELEASE} +update_ansible_role_requirements ${OSA_BRANCH} ${PRE_RELEASE} ${FORCE_MASTER} update_release_version ${OSA_BRANCH} ${SERVICE_FILE}