From 84b7f665a1f791103948f25530cd15a08b6d0303 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Wed, 26 Sep 2012 11:43:07 -0700 Subject: [PATCH] Publish python-*client docs only on releases. Modify the run-docs script to upload the latest tagged release docs to the root dir of a projects developer docs and to a dir for the tagged release. With this in place and the python-*client-docs jobs running only in the publish queue we will see documents at docs.openstack.org/developer that follow the latest releases for the client projects. Finally, re add the python-*client docs jobs as they were the projects that wanted this behavior in the first place. Fixes bug #1040251 Change-Id: Ia3cf07d860b10214ed54fcf9748330866cb47f5d Reviewed-on: https://review.openstack.org/13725 Reviewed-by: James E. Blair Approved: James E. Blair Tested-by: Jenkins --- .../jenkins/files/slave_scripts/run-docs.sh | 24 +++++++++++++++---- .../openstack_project/files/zuul/layout.yaml | 7 ------ 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/modules/jenkins/files/slave_scripts/run-docs.sh b/modules/jenkins/files/slave_scripts/run-docs.sh index d8ca3cf9e1..135eed8606 100755 --- a/modules/jenkins/files/slave_scripts/run-docs.sh +++ b/modules/jenkins/files/slave_scripts/run-docs.sh @@ -14,14 +14,30 @@ export HUDSON_PUBLISH_DOCS=1 tox -e$venv -- python setup.py build_sphinx result=$? if `echo $GERRIT_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.//'` if [ ! -z $TAG ] ; then - # Move the docs into a subdir if this is a tagged build - mkdir doc/build/$TAG - mv doc/build/html/* doc/build/$TAG - mv doc/build/$TAG doc/build/html/$TAG + LATEST=`git tag | sed -n '/^\([0-9]\+\.\?\)\+$/p' | sort -n | tail -1` + if [ "$TAG" = "$LATEST" ] ; then + # Copy the docs into a subdir if this is a tagged build + mkdir doc/build/$TAG + cp -R doc/build/html/* doc/build/$TAG + mv doc/build/$TAG doc/build/html/$TAG + else + # Move the docs into a subdir if this is a tagged build + mkdir doc/build/$TAG + mv doc/build/html/* doc/build/$TAG + mv doc/build/$TAG doc/build/html/$TAG + fi fi elif `echo $GERRIT_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.//'` if [ ! -z $BRANCH ] ; then # Move the docs into a subdir if this is a stable branch build diff --git a/modules/openstack_project/files/zuul/layout.yaml b/modules/openstack_project/files/zuul/layout.yaml index a8d938aa8c..348a09679a 100644 --- a/modules/openstack_project/files/zuul/layout.yaml +++ b/modules/openstack_project/files/zuul/layout.yaml @@ -401,7 +401,6 @@ projects: post: - python-cinderclient-sdist-tarball - python-cinderclient-coverage - - python-cinderclient-docs publish: - python-cinderclient-pypi - python-cinderclient-docs @@ -426,7 +425,6 @@ projects: post: - python-glanceclient-sdist-tarball - python-glanceclient-coverage - - python-glanceclient-docs publish: - python-glanceclient-pypi - python-glanceclient-docs @@ -451,7 +449,6 @@ projects: post: - python-keystoneclient-sdist-tarball - python-keystoneclient-coverage - - python-keystoneclient-docs publish: - python-keystoneclient-pypi - python-keystoneclient-docs @@ -476,7 +473,6 @@ projects: post: - python-novaclient-sdist-tarball - python-novaclient-coverage - - python-novaclient-docs publish: - python-novaclient-pypi - python-novaclient-docs @@ -497,7 +493,6 @@ projects: post: - python-openstackclient-sdist-tarball - python-openstackclient-coverage - - python-openstackclient-docs publish: - python-openstackclient-pypi - python-openstackclient-docs @@ -522,7 +517,6 @@ projects: post: - python-quantumclient-sdist-tarball - python-quantumclient-coverage - - python-quantumclient-docs publish: - python-quantumclient-pypi - python-quantumclient-docs @@ -543,7 +537,6 @@ projects: post: - python-swiftclient-sdist-tarball - python-swiftclient-coverage - - python-swiftclient-docs publish: - python-swiftclient-pypi - python-swiftclient-docs