Fix tag publishing of server projects
Projects using openstack-server-publish-jobs publish documents both from post and release pipelines. Now a tag on stable branch will publish the documents both to developer/$project/$tag and developer/$project. This overrides the documents published in the post pipeline - replacing master documents with stable documents. The publishing to both locations is correct for projects that only publish as part of releases but not for those useing openstack-server-publish-jobs. To fix this: Create a new job '{name}-docs-tags-only' that adds a new parameter to run-docs script. If that parameter is passed, tag publishing will only happen to developer/$project/$tag . Add the new job to the openstack-publish-jobs so that all projects can use it. Adapt openstack-server-publish-jobs in zuul to use the new job. This change also adds constraint version of the publishing job. A new builder docs-tags-only-env has beend added for the new jobs. Change-Id: If0d000358f17a7d9ea0b8c3e3aada1c16291b3ee
This commit is contained in:
parent
3a19c89bdf
commit
68c2723f49
@ -158,6 +158,11 @@
|
||||
builders:
|
||||
- shell: "/usr/local/jenkins/slave_scripts/run-docs.sh {env}"
|
||||
|
||||
- builder:
|
||||
name: docs-tags-only-env
|
||||
builders:
|
||||
- shell: "/usr/local/jenkins/slave_scripts/run-docs.sh {env} tags-only"
|
||||
|
||||
- builder:
|
||||
name: docs
|
||||
builders:
|
||||
|
@ -19,6 +19,29 @@
|
||||
- console-log
|
||||
|
||||
|
||||
- job-template:
|
||||
name: '{name}-docs-tags-only'
|
||||
description: Publish documents only to tag location
|
||||
node: bare-trusty
|
||||
|
||||
builders:
|
||||
- print-template-name:
|
||||
template-name: "{template-name}"
|
||||
- revoke-sudo
|
||||
- gerrit-git-prep
|
||||
- docs-tags-only-env:
|
||||
env: venv
|
||||
|
||||
publishers:
|
||||
- ftp:
|
||||
site: '{doc-publisher-site}'
|
||||
source: 'doc/build/html/**'
|
||||
target: 'developer/{name}'
|
||||
remove-prefix: 'doc/build/html'
|
||||
excludes: ''
|
||||
- console-log
|
||||
|
||||
|
||||
- job-template:
|
||||
name: '{name}-docs-constraints'
|
||||
node: bare-trusty
|
||||
@ -41,6 +64,29 @@
|
||||
- console-log
|
||||
|
||||
|
||||
- job-template:
|
||||
name: '{name}-docs-tags-only-constraints'
|
||||
description: Publish documents only to tag location, uses constraints
|
||||
node: bare-trusty
|
||||
|
||||
builders:
|
||||
- print-template-name:
|
||||
template-name: "{template-name}"
|
||||
- revoke-sudo
|
||||
- zuul-git-prep-upper-constraints
|
||||
- docs-tags-only-env:
|
||||
env: venv-constraints
|
||||
|
||||
publishers:
|
||||
- ftp:
|
||||
site: '{doc-publisher-site}'
|
||||
source: 'doc/build/html/**'
|
||||
target: 'developer/{name}'
|
||||
remove-prefix: 'doc/build/html'
|
||||
excludes: ''
|
||||
- console-log
|
||||
|
||||
|
||||
- job-template:
|
||||
name: '{name}-merge-release-tags'
|
||||
|
||||
@ -106,7 +152,9 @@
|
||||
name: openstack-publish-jobs
|
||||
jobs:
|
||||
- '{name}-docs'
|
||||
- '{name}-docs-tags-only'
|
||||
- '{name}-docs-constraints'
|
||||
- '{name}-docs-tags-only-constraints'
|
||||
- '{name}-merge-release-tags'
|
||||
|
||||
|
||||
|
@ -8,6 +8,7 @@
|
||||
#
|
||||
|
||||
venv=${1:-venv}
|
||||
tags_handling=${2:both}
|
||||
|
||||
mkdir -p doc/build
|
||||
export HUDSON_PUBLISH_DOCS=1
|
||||
@ -41,9 +42,10 @@ elif echo $ZUUL_REFNAME | grep refs/tags/ >/dev/null ; then
|
||||
# versions. The date versions will sort higher even though they
|
||||
# should not so we just special case it here.
|
||||
LATEST=$(git tag | sed -n -e '/^20[0-9]\{2\}\..*$/d' -e '/^[0-9]\+\(\.[0-9]\+\)*$/p' | sort -V | tail -1)
|
||||
# Now publish to / and /$TAG if this is the latest version or
|
||||
# just /$TAG if this is not the latest version.
|
||||
if [ "$TAG" = "$LATEST" ] ; then
|
||||
# Now publish to / and /$TAG if this is the latest version for projects
|
||||
# and we are only publishing from the release pipeline,
|
||||
# or just /$TAG otherwise.
|
||||
if [ "$tags_handling" = "tags-only" -a "$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
|
||||
|
@ -409,7 +409,7 @@ project-templates:
|
||||
post:
|
||||
- '{name}-docs'
|
||||
release:
|
||||
- '{name}-docs'
|
||||
- '{name}-docs-tags-only'
|
||||
|
||||
- name: openstack-client-publish-jobs
|
||||
release:
|
||||
|
Loading…
x
Reference in New Issue
Block a user