From 8763a01914ea74a8241eda925381279947dca25a Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Wed, 5 Jul 2017 14:49:27 -0400 Subject: [PATCH] fix publishing directory depth for the unified publishing job The run-docs.sh script already does some renaming and file moving for us, so the unified publishing job needs to be more careful about the renaming it does as it prepares files for publishing. We want everything for a project to appear under docs.o.o/$project/, with master going to "latest", other stable branches going to $series, and tagged versions going to a directory named for the tag. Change-Id: I4c0350b29ff910e5acdd1c0982d0096a20188495 Signed-off-by: Doug Hellmann --- jenkins/jobs/openstack-publish-jobs.yaml | 41 +++++++++++++++--------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/jenkins/jobs/openstack-publish-jobs.yaml b/jenkins/jobs/openstack-publish-jobs.yaml index 07018bbfd8..c90df2226b 100644 --- a/jenkins/jobs/openstack-publish-jobs.yaml +++ b/jenkins/jobs/openstack-publish-jobs.yaml @@ -31,7 +31,7 @@ - revoke-sudo - docs - add-docs-root-marker: - docsrootdir: 'doc/build/html' + docsrootdir: 'doc/build' - shell: | #!/bin/bash -x @@ -47,36 +47,45 @@ tag="" fi - # When we have a tag, we want to use that as the publishing - # location so that we get version-specific docs. Otherwise, - # when building from master we want to publish to the - # "latest" directory and when building from a stable branch, - # we want to publish to a directory using that branch base - # name. Building from other branches is an error. + # Rearrange the build output to reflect the end publishing + # location, so we can use doc/publish as the source for the + # publisher step. + mkdir -p doc/publish + if [[ ! -z "$tag" ]]; then - publish_name=$tag + # run-docs.sh will have already moved the content inside + # a directory named for the tag, so we move that + # directory to the publish location. + mv doc/build/html/$tag doc/publish/ + mv doc/build/.root-marker doc/publish/$tag/ + elif [[ $branch_name = master ]]; then - publish_name=latest + # run-docs.sh does not rename the output directory, but + # we want it to be called "latest". + mv doc/build/html doc/publish/latest + mv doc/build/.root-marker doc/publish/latest/ + elif [[ $branch_name =~ stable/ ]]; then - publish_name=$(basename $branch_name) + # run-docs.sh will have already moved the content inside + # a directory named for the branch, so move that to the + # publish location. + mv doc/build/html/$(basename $branch_name) doc/publish/ + mv doc/build/.root-marker doc/publish/$(basename $branch_name) + elif [[ $branch_name =~ feature/ ]]; then echo "Docs should not be published for feature branches" exit 1 + elif [[ $branch_name =~ driverfixes/ ]]; then echo "Docs should not be published for feature branches" exit 1 + else # What is this even? echo "Could not determine publishing location for branch_name $branch_name" exit 1 fi - # Rearrange the build output to reflect the end publishing - # location, so we can use doc/publish as the source for the - # publisher step. - mkdir -p doc/publish - mv doc/build/html doc/publish/$publish_name - publishers: - afs: site: afs-docs