From 78015656020732f16647d2e32ff7e791f7fe1b24 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Wed, 2 Mar 2016 21:08:58 +0100 Subject: [PATCH] Use ZUUL_REFNAME (1/2) for branch checking We should use ZUUL_REFNAME instead of ZUUL_REF. Change propose_update.sh to use REFNAME. Since propose_update.sh is deployed at different time than the JJB update, let's pass both variables for now and cleanup once new images are generated. Change-Id: I8d77840d4d745b4df787e9f8d572ef10b3902b82 --- jenkins/jobs/requirements.yaml | 1 + jenkins/scripts/propose_update.sh | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/jenkins/jobs/requirements.yaml b/jenkins/jobs/requirements.yaml index 1bcf5d78b0..16e695e53f 100644 --- a/jenkins/jobs/requirements.yaml +++ b/jenkins/jobs/requirements.yaml @@ -284,6 +284,7 @@ - branch-git-prep: branch: '{branch-override}' - shell: | + export ZUUL_REFNAME={branch-override} export ZUUL_REF={branch-override} /usr/local/jenkins/slave_scripts/propose_update.sh \ requirements-constraints diff --git a/jenkins/scripts/propose_update.sh b/jenkins/scripts/propose_update.sh index d69efa5585..3cad424c0f 100755 --- a/jenkins/scripts/propose_update.sh +++ b/jenkins/scripts/propose_update.sh @@ -64,8 +64,8 @@ fi USERNAME="proposal-bot" ALL_SUCCESS=0 -if [ -z "$ZUUL_REF" ] ; then - echo "No ZUUL_REF set, exiting." +if [ -z "$ZUUL_REFNAME" ] ; then + echo "No ZUUL_REFNAME set, exiting." exit 1 fi @@ -93,10 +93,10 @@ for PROJECT in $PROJECTS; do # check whether the project has this branch or a suitable fallback BRANCH="" - if git branch -a | grep -q "^ remotes/origin/$ZUUL_REF$" ; then - BRANCH=$ZUUL_REF - elif echo $ZUUL_REF | grep -q "^stable/" ; then - FALLBACK=$(echo $ZUUL_REF | sed s,^stable/,proposed/,) + if git branch -a | grep -q "^ remotes/origin/$ZUUL_REFNAME$" ; then + BRANCH=$ZUUL_REFNAME + elif echo $ZUUL_REFNAME | grep -q "^stable/" ; then + FALLBACK=$(echo $ZUUL_REFNAME | sed s,^stable/,proposed/,) if git branch -a | grep -q "^ remotes/origin/$FALLBACK$" ; then BRANCH=$FALLBACK fi