From a09f0255f71d2c06d748922aa2e5e6390a0d75a0 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Fri, 10 Apr 2015 14:38:13 +0000 Subject: [PATCH] Change proposals fall back on proposed branches During the RC period for a project, there may already be a stable branch for the release on the triggering project and a proposed branch on the target project. If so, we want stable changes proposed to the proposed branch. That's not confusing! Change-Id: I488bb9ff63daf9d012e41dbaa178b1656eaeffad --- jenkins/scripts/propose_update.sh | 70 ++++++++++++++++++------------- 1 file changed, 40 insertions(+), 30 deletions(-) diff --git a/jenkins/scripts/propose_update.sh b/jenkins/scripts/propose_update.sh index c8ff6a7faf..22005e7a87 100755 --- a/jenkins/scripts/propose_update.sh +++ b/jenkins/scripts/propose_update.sh @@ -25,11 +25,10 @@ else TOPIC="openstack/openstack-manuals" fi USERNAME="proposal-bot" -BRANCH=$ZUUL_REF ALL_SUCCESS=0 -if [ -z "$BRANCH" ] ; then - echo "No branch set, exiting." +if [ -z "$ZUUL_REF" ] ; then + echo "No ZUUL_REF set, exiting." exit 1 fi @@ -39,38 +38,49 @@ git config gitreview.username "proposal-bot" for PROJECT in $(cat projects.txt); do - change_id="" - # See if there is an open change in the openstack/requirements topic - # If so, get the change id for the existing change for use in the - # commit msg. - change_info=$(ssh -p 29418 $USERNAME@review.openstack.org gerrit query --current-patch-set status:open project:$PROJECT topic:$TOPIC owner:$USERNAME branch:$BRANCH) - previous=$(echo "$change_info" | grep "^ number:" | awk '{print $2}') - if [ "x${previous}" != "x" ] ; then - change_id=$(echo "$change_info" | grep "^change" | awk '{print $2}') - # read return a non zero value when it reaches EOF. Because we use a - # heredoc here it will always reach EOF and return a nonzero value. - # Disable -e temporarily to get around the read. - # The reason we use read is to allow for multiline variable content - # and variable interpolation. Simply double quoting a string across - # multiple lines removes the newlines. - set +e - read -d '' COMMIT_MSG <