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
This commit is contained in:
Andreas Jaeger 2016-03-02 21:08:58 +01:00
parent 93d81b5e11
commit 7801565602
2 changed files with 7 additions and 6 deletions

View File

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

View File

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