From c108532b328a03f6bf2e6971d5f842aec315c21e Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Fri, 31 May 2013 14:19:01 -0700 Subject: [PATCH] Don't publish non-master docs to master location. The current run-docs script only moves the publishing location on tags or stable branches. This makes it so that master docs stay where they are, stable branches and tags have the current behavior, and anything else is placed in the branch name. This should affect milestone-proposed (which will be published to .../milestone-proposed/) and feature branches (.../feature/foo). Currently, these two cases are in a race with master -- last change wins. Change-Id: If1e09d31a7001255746ba1a91b641b95f42fcfbb Reviewed-on: https://review.openstack.org/31300 Reviewed-by: Clark Boylan Approved: James E. Blair Tested-by: Jenkins --- modules/jenkins/files/slave_scripts/run-docs.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/jenkins/files/slave_scripts/run-docs.sh b/modules/jenkins/files/slave_scripts/run-docs.sh index 1b7e1d5989..10823f3bf9 100755 --- a/modules/jenkins/files/slave_scripts/run-docs.sh +++ b/modules/jenkins/files/slave_scripts/run-docs.sh @@ -27,7 +27,10 @@ mkdir -p doc/build export HUDSON_PUBLISH_DOCS=1 tox -e$venv -- python setup.py build_sphinx result=$? -if `echo $ZUUL_REFNAME | grep refs/tags/ >/dev/null` ; then + +if [ $ZUUL_REFNAME == "master" ] ; then + : # Leave the docs where they are. +elif `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 @@ -67,6 +70,16 @@ elif `echo $ZUUL_REFNAME | grep stable/ >/dev/null` ; then mv doc/build/html/* doc/build/$BRANCH mv doc/build/$BRANCH doc/build/html/$BRANCH fi +else + # Put other branch changes in dir named after branch under the + # build dir. When Jenkins copies these files they will be + # accessible under the developer docs root using the branch name. + # EG: feature/foo or milestone-proposed + BRANCH=$ZUUL_REFNAME + mkdir doc/build/tmp + mv doc/build/html/* doc/build/tmp + mkdir -p doc/build/html/$BRANCH + mv doc/build/tmp/* doc/build/html/$BRANCH fi echo "Begin pip freeze output from test virtualenv:"