Set ZUUL_BRANCH using BRANCH if not available

In most cases, ZUUL_BRANCH is set in gate, but not all the time. One
exception is e.g. periodic stable jobs, where there is no actual patch
to validate, hence no ZUUL_REF or ZUUL_BRANCH is set. In that case, we
need to help zuul-cloner to determine the proper branch to fetch
neutron.

It could be achieved by e.g. hardcoding the branch using --zuul_branch
CLI argument passed into zuul-cloner. In this patch, I instead set
ZUUL_BRANCH to BRANCH that seems to be always present in all kinds of
jobs. It is then used by zuul-cloner to choose the correct branch.

This fixes the issue for stable/liberty periodic jobs for neutron-vpnaas
when we tried to validate it against neutron/master.

Change-Id: I360239a1443f8d4e16210a1ef743912e1bf85f41
This commit is contained in:
Ihar Hrachyshka 2015-11-10 17:47:00 +01:00
parent 1efb810a7f
commit 308b3a3a5d

View File

@ -30,6 +30,7 @@ elif [ $neutron_installed -eq 0 ]; then
location=$(python -c "import neutron; print(neutron.__file__)")
echo "ALREADY INSTALLED at $location"
elif [ -x "$ZUUL_CLONER" ]; then
export ZUUL_BRANCH=${ZUUL_BRANCH-$BRANCH}
echo "USING ZUUL CLONER to obtain Neutron code"
cwd=$(/bin/pwd)
cd /tmp