Allow BRANCH instead of ZUUL_REF in ggp

* modules/jenkins/files/slave_scripts/gerrit-git-prep.sh: Allow
callers to supply BRANCH in the environment for cases where there
will be no ZUUL_REF environment variable. This is mainly to support
use in periodic jobs, so that we can transition away from the
Jenkins SCM plug-in.

Change-Id: I86c77695d8c374c94932664026ab7a541686ae74
This commit is contained in:
Jeremy Stanley 2014-03-18 15:37:58 +00:00
parent c5da9c008d
commit 2e21b966c9

View File

@ -24,8 +24,16 @@ fi
if [ -z "$ZUUL_REF" ]
then
echo "This job may only be triggered by Zuul."
exit 1
if [ -n "$BRANCH" ]
then
echo "No ZUUL_REF so using requested branch $BRANCH from origin."
ZUUL_REF=$BRANCH
# use the origin since zuul mergers have outdated branches
ZUUL_URL=$GIT_ORIGIN
else
echo "Provide either ZUUL_REF or BRANCH in the calling enviromnent."
exit 1
fi
fi
if [ ! -z "$ZUUL_CHANGE" ]