Use publish-docs for Zuul v3

With Zuul v2, the publishing happens from publish-docs/api-ref.
Let's simplify our scripts and publish with Zuul v3 from publish-docs
directly.

Add new jobs publishlang and publishbuild for Zuul v3 publishing.
Use existing publishlang-api and publishbuild-api for Zuul v2
publishing.

Remove now obsolete comment from doc-tools-check-languages.conf.

Change-Id: I32b29a34c571882cb4d7c542c543ea726e76a0b5
This commit is contained in:
Andreas Jaeger 2017-10-09 21:33:58 +02:00
parent f679b56fdb
commit 9d230819a6
6 changed files with 43 additions and 64 deletions

View File

@ -1,24 +1,9 @@
# IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
# Note that we publish all files to developer.openstack.org using
# "tox -e publishlang-api".
# Our script doc-tools-check-languages places guides in the wrong
# directories, they need to be moved in tox.ini manually to the right
# place for publishing.
# We publish:
# The api-quick-start at:
# http:/developer.openstack.org/LANG/api-guide/quick-start
# directories to be set up
# Directories to be set up
declare -A DIRECTORIES=(
)
# books to be built
declare -A BOOKS=(
# See comment at start of file and update tox.ini as well if you
# change anything here.
["de"]="api-quick-start firstapp"
["id"]="api-quick-start firstapp"
["ja"]="api-quick-start"

View File

@ -2,4 +2,4 @@
mkdir -p publish-docs
tools/build-rst.sh api-quick-start --target api-ref/api-guide/quick-start
tools/build-rst.sh api-quick-start --target api-guide/quick-start

View File

@ -5,11 +5,11 @@ mkdir -p publish-docs
# Publish documents to api-ref for developer.openstack.org
for tag in libcloud shade; do
tools/build-rst.sh firstapp \
--tag ${tag} --target "api-ref/firstapp-${tag}"
--tag ${tag} --target "firstapp-${tag}"
done
# Draft documents
for tag in dotnet fog openstacksdk pkgcloud jclouds gophercloud; do
tools/build-rst.sh firstapp \
--tag ${tag} --target "api-ref/draft/firstapp-${tag}"
--tag ${tag} --target "draft/firstapp-${tag}"
done

View File

@ -34,18 +34,14 @@ if [ "$PUBLISH" = "build" ] ; then
openstack-indexpage publish-docs
fi
if [ "$PUBLISH" = "publish" ] ; then
# Publication happens from publish-docs/api-ref to
# developer.openstack.org, so move content around
mkdir -p publish-docs/api-ref/
python tools/www-generator.py --source-directory www/ \
--output-directory publish-docs/api-ref/
rsync -a www/static/ publish-docs/api-ref/
--output-directory publish-docs/
rsync -a www/static/ publish-docs/
# Don't publish this file
rm publish-docs/api-ref/www-index.html
rm publish-docs/www-index.html
# This marker is needed for infra publishing
MARKER_TEXT="Project: $ZUUL_PROJECT Ref: $ZUUL_REFNAME Build: $ZUUL_UUID"
echo $MARKER_TEXT > publish-docs/api-ref/.root-marker
echo $MARKER_TEXT > publish-docs/.root-marker
fi

View File

@ -1,14 +0,0 @@
#!/bin/bash -xe
LANGDIR=$1
if [[ -z "$LANGDIR" ]] ; then
echo "usage $0 language"
exit 1
fi
# Move all firstapp files for one language into the api-ref directory
# since that directory is used for publishing.
mkdir -p publish-docs/api-ref/$LANGDIR/
mv publish-docs/$LANGDIR/firstapp* publish-docs/api-ref/$LANGDIR/

58
tox.ini
View File

@ -33,7 +33,7 @@ commands =
# Build website index
{toxinidir}/tools/build-index.sh build
[testenv:publishdocs-api]
[testenv:publishdocs]
# Prepare documents (without www) so that they can get published on
# developer.openstack.org with just copying publish-docs/api-ref over.
commands =
@ -44,6 +44,22 @@ commands =
# Build website index
{toxinidir}/tools/build-index.sh publish
[testenv:publishdocs-api]
# publishdocs will replace this, leave this in for transition
whitelist_externals =
mkdir
mv
commands =
{[testenv:publishdocs]commands}
# Now move everything to api-ref directory since that's where
# OpenStack CI expects it with this job.
# We need to move the content of publish-docs into publish-docs/api-ref.
# Tox does not allow us using wildcards here.
mkdir .newdir
# This renames publish-docs to api-ref
mv publish-docs .newdir/api-ref
mv .newdir publish-docs
[testenv:checklang]
whitelist_externals = doc-tools-check-languages
commands = doc-tools-check-languages doc-tools-check-languages.conf test all
@ -53,9 +69,9 @@ commands = doc-tools-check-languages doc-tools-check-languages.conf test all
whitelist_externals = doc-tools-check-languages
commands = doc-tools-check-languages doc-tools-check-languages.conf test {posargs}
[testenv:publishlang-api]
[testenv:publishlang]
# Publish translated documents to developer.openstack.org with just
# copying publish-docs/api-ref over.
# copying publish-docs over.
whitelist_externals =
doc-tools-check-languages
mkdir
@ -67,26 +83,22 @@ commands =
# multiple times.
rm -rf publish-docs
doc-tools-check-languages doc-tools-check-languages.conf publish all
# Move directories to proper place, we publish translated
# quick-start guides at
# developer.openstack.org/LANG/api-guide/quick-start or
# developer.openstack.org/draft/LANG/api-guide/quick-start.
mkdir -p publish-docs/api-ref
mkdir -p publish-docs/api-ref/de/api-guide
mkdir -p publish-docs/api-ref/id/api-guide
mkdir -p publish-docs/api-ref/ja/api-guide
mkdir -p publish-docs/api-ref/ko_KR/api-guide
mkdir -p publish-docs/api-ref/tr_TR/api-guide
mkdir -p publish-docs/api-ref/zh_CN/api-guide
mv publish-docs/de/api-quick-start/ publish-docs/api-ref/de/api-guide/quick-start
mv publish-docs/id/api-quick-start/ publish-docs/api-ref/id/api-guide/quick-start
mv publish-docs/ja/api-quick-start/ publish-docs/api-ref/ja/api-guide/quick-start
mv publish-docs/ko_KR/api-quick-start/ publish-docs/api-ref/ko_KR/api-guide/quick-start
mv publish-docs/tr_TR/api-quick-start/ publish-docs/api-ref/tr_TR/api-guide/quick-start
mv publish-docs/zh_CN/api-quick-start/ publish-docs/api-ref/zh_CN/api-guide/quick-start
{toxinidir}/tools/mv-firstapp-trans.sh de
{toxinidir}/tools/mv-firstapp-trans.sh id
{toxinidir}/tools/mv-firstapp-trans.sh tr_TR
[testenv:publishlang-api]
# publishlang will replace this, leave this in for transition
whitelist_externals =
mkdir
mv
commands =
{[testenv:publishlang]commands}
# Now move everything to api-ref directory since that's where
# OpenStack CI expects it with this job.
# We need to move the content of publish-docs into publish-docs/api-ref.
# Tox does not allow us using wildcards here.
mkdir .newdir
# This renames publish-docs to api-ref
mv publish-docs .newdir/api-ref
mv .newdir publish-docs
[testenv:generatepot-rst]
# Generate POT files for translation, needs {posargs} like: