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
This commit is contained in:
Markos Chandras 2017-05-15 16:22:28 +01:00 committed by Jesse Pretorius (odyssey4me)
parent b55fc7240d
commit 002c35fbe6
2 changed files with 6 additions and 3 deletions

View File

@ -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

View File

@ -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}