Fix ZUUL_REFNAME

Set up the variables the same way the post job is set up:
Pass them in via environment in job definition.

Pass ZUUL_ environment variables through to jobs.

Note ZUUL_REFNAME is not set, use ZUUL_BRANCH instead.

Change-Id: I5863a05384c9a48445d5ce52ccc508519c7c00f8
This commit is contained in:
Andreas Jaeger 2017-11-23 14:20:10 +01:00
parent 158fd357cd
commit 21edbc931f
3 changed files with 13 additions and 4 deletions

View File

@ -18,6 +18,14 @@
post-run: playbooks/build-manuals-tox/post.yaml
roles:
- zuul: openstack-infra/zuul-jobs
vars:
tox_environment:
# The tox job writes the root-marker file directly and thus
# needs the following variables set:
ZUUL_PROJECT: '{{ zuul.project.name }}'
ZUUL_BRANCH: '{{ zuul.branch }}'
ZUUL_UUID: '{{ zuul.build }}'
ZUUL_NEWREF: '{{ zuul.ref }}'
- job:
name: build-tox-manuals-checkbuild

View File

@ -3,13 +3,13 @@
mkdir -p publish-docs
# Set this to a sensible value if not set by OpenStack CI.
if [ -z "$ZUUL_REFNAME" ] ; then
ZUUL_REFNAME="master"
if [ -z "$ZUUL_BRANCH" ] ; then
ZUUL_BRANCH="master"
fi
# This marker is needed for infra publishing.
# Note for stable branches, this needs to be the top of each manual.
MARKER_TEXT="Project: $ZUUL_PROJECT Ref: $ZUUL_REFNAME Build: $ZUUL_UUID Revision: $ZUUL_NEWREV"
MARKER_TEXT="Project: $ZUUL_PROJECT Ref: $ZUUL_BRANCH Build: $ZUUL_UUID Revision: $ZUUL_NEWREV"
LINKCHECK=""
PDF_OPTION=""
@ -44,6 +44,6 @@ for guide in arch-design doc-contrib-guide glossary \
done
# For master, just mark the root
if [ "$ZUUL_REFNAME" = "master" ] ; then
if [ "$ZUUL_BRANCH" = "master" ] ; then
echo $MARKER_TEXT > publish-docs/.root-marker
fi

View File

@ -8,6 +8,7 @@ basepython=python2.7
setenv =
VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/test-requirements.txt
passenv = ZUUL_*
whitelist_externals =
bash
cp