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-lbaas
when we tried to validate it against neutron/master.

Change-Id: I360239a1443f8d4e16210a1ef743912e1bf85f41
(cherry picked from commit d103c03156)
This commit is contained in:
Ihar Hrachyshka 2015-11-09 23:15:14 +01:00
parent afa21b5c70
commit acdb72f70c

View File

@ -22,6 +22,7 @@ if [ $neutron_installed -eq 0 ]; then
echo "ALREADY INSTALLED" > /tmp/tox_install.txt
echo "Neutron already installed; using existing package"
elif [ -x "$ZUUL_CLONER" ]; then
export ZUUL_BRANCH=${ZUUL_BRANCH-$BRANCH}
echo "ZUUL CLONER" > /tmp/tox_install.txt
cwd=$(/bin/pwd)
cd /tmp