Update run-docs to handle old python-*client tags

Some of the python-*client repos have year.release tags which are not
used anymore. These tags are always greater than the current versioning
scheme and thus break the logic in run-docs.sh of taking the largest tag
number as the latest tag. Ignore any tag beginning with '2012.' to when
running this script on the python-*client projects.

Also, since I was editing the file I ran s/GERRIT/ZUUL/ to update the
environment variables to the ones we want to be using in the future.

Change-Id: I6f7a5aeddd4a8fd69f25382682fceebf94bea629
Reviewed-on: https://review.openstack.org/13916
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
This commit is contained in:
Clark Boylan 2012-10-01 11:39:38 -07:00 committed by Jenkins
parent c607544366
commit 3bff88868b

View File

@ -13,15 +13,23 @@ mkdir -p doc/build
export HUDSON_PUBLISH_DOCS=1
tox -e$venv -- python setup.py build_sphinx
result=$?
if `echo $GERRIT_REFNAME | grep refs/tags/ >/dev/null` ; then
if `echo $ZUUL_REFNAME | grep refs/tags/ >/dev/null` ; then
# Put tagged releases in proper location. All tagged builds get copied to
# BUILD_DIR/tagname. If this is the latest tagged release the copy of files
# at BUILD_DIR remains. When Jenkins copies this file the root developer
# docs are always the latest release with older tags available under the
# root in the tagname dir.
TAG=`echo $GERRIT_REFNAME | sed 's/refs.tags.//'`
TAG=`echo $ZUUL_REFNAME | sed 's/refs.tags.//'`
if [ ! -z $TAG ] ; then
LATEST=`git tag | sed -n '/^\([0-9]\+\.\?\)\+$/p' | sort -n | tail -1`
if echo $ZUUL_PROJECT | grep 'python-.*client' ; then
# This is a hack to ignore the year.release tags in python-*client
# projects.
LATEST=`git tag | sed -n -e '/^2012\..*$/d' -e '/^\([0-9]\+\.\?\)\+$/p' | sort -n | tail -1`
else
# Take all tags of the form (number.)+, sort them, then take the
# largest
LATEST=`git tag | sed -n '/^\([0-9]\+\.\?\)\+$/p' | sort -n | tail -1`
fi
if [ "$TAG" = "$LATEST" ] ; then
# Copy the docs into a subdir if this is a tagged build
mkdir doc/build/$TAG
@ -34,11 +42,11 @@ if `echo $GERRIT_REFNAME | grep refs/tags/ >/dev/null` ; then
mv doc/build/$TAG doc/build/html/$TAG
fi
fi
elif `echo $GERRIT_REFNAME | grep stable/ >/dev/null` ; then
elif `echo $ZUUL_REFNAME | grep stable/ >/dev/null` ; then
# Put stable release changes in dir named after stable release under the
# build dir. When Jenkins copies these files they will be accessible under
# the developer docs root using the stable release's name.
BRANCH=`echo $GERRIT_REFNAME | sed 's/stable.//'`
BRANCH=`echo $ZUUL_REFNAME | sed 's/stable.//'`
if [ ! -z $BRANCH ] ; then
# Move the docs into a subdir if this is a stable branch build
mkdir doc/build/$BRANCH