Make root-marker generation more robust

Check whether we're on master or stable branch and create marker in the
correct place. This ensures that they are always properly set.

Change-Id: I4fede4a1e9d8a15fa7f932feefdb5eab13685aca
This commit is contained in:
Andreas Jaeger 2016-12-12 11:29:56 +01:00
parent 6b113f2c97
commit 03c1a36960
2 changed files with 34 additions and 6 deletions

View File

@ -2,6 +2,15 @@
mkdir -p publish-docs
# Set this to a sensible value if not set by OpenStack CI.
if [ -z "$ZUUL_REFNAME" ] ; then
ZUUL_REFNAME="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"
LINKCHECK=""
if [[ $# > 0 ]] ; then
if [ "$1" = "--linkcheck" ] ; then
@ -16,6 +25,7 @@ PDF_TARGETS=( 'arch-design' 'arch-design-draft' 'cli-reference'\
'ha-guide' 'networking-guide'\
'ops-guide' 'user-guide' )
# Note that these guides are only build for master branch
for guide in admin-guide arch-design cli-reference contributor-guide \
ha-guide image-guide ops-guide user-guide; do
if [[ ${PDF_TARGETS[*]} =~ $guide ]]; then
@ -38,11 +48,15 @@ for guide in networking-guide arch-design-draft config-reference; do
tools/build-rst.sh doc/$guide --build build \
--target "draft/$guide" $LINKCHECK
fi
# For stable branches, we need to mark the specific guides.
if [ "$ZUUL_REFNAME" != "master" ] ; then
echo $MARKER_TEXT > publish-docs/draft/$guide/.root-marker
fi
done
tools/build-install-guides-rst.sh $LINKCHECK
# 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"
echo $MARKER_TEXT > publish-docs/.root-marker
# For master, just mark the root
if [ "$ZUUL_REFNAME" = "master" ] ; then
echo $MARKER_TEXT > publish-docs/.root-marker
fi

View File

@ -22,12 +22,22 @@ fi
cp -f ${INDEX} ${INDEX}.save
trap "mv -f ${INDEX}.save ${INDEX}" EXIT
# Set this to a sensible value if not set by OpenStack CI.
if [ -z "$ZUUL_REFNAME" ] ; then
ZUUL_REFNAME="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"
for tag in $TAGS; do
TARGET="draft/install-guide-${tag}"
if [[ "$tag" == "debconf" ]]; then
# Build the guide with debconf
# To use debian only contents, use "debian" tag.
tools/build-rst.sh doc/install-guide-debconf \
--tag debian --target "draft/install-guide-${tag}" $LINKCHECK --pdf
--tag debian --target "$TARGET" $LINKCHECK --pdf
else
##
# Because Sphinx uses the first heading as title regardless of
@ -40,6 +50,10 @@ for tag in $TAGS; do
# Build the guide
tools/build-rst.sh doc/install-guide \
--tag ${tag} --target "draft/install-guide-${tag}" $LINKCHECK --pdf
--tag ${tag} --target "$TARGET" $LINKCHECK --pdf
fi
# Add this for stable branches
if [ "$ZUUL_REFNAME" != "master" ] ; then
echo $MARKER_TEXT > publish-docs/$TARGET/.root-marker
fi
done