Switch output to publish-docs/html

Publishing to a top-level directory has a few challenges with some new
infra scripts. Let's keep those simple and change from publish-docs to
publish-docs/html.

Depends-On: https://review.opendev.org/676489
Change-Id: I94b7bf915c0fdad0e9e2f5dd81846f45dc99194a
This commit is contained in:
Andreas Jaeger 2019-08-14 20:28:25 +02:00
parent 7df391e2e5
commit 741d59c459
8 changed files with 36 additions and 27 deletions

View File

@ -9,14 +9,14 @@
description: | description: |
Base job to build manual related documents. These build jobs Base job to build manual related documents. These build jobs
invoke a tox command and expect the published content to be in invoke a tox command and expect the published content to be in
publish-docs directory. This content is published on the root of publish-docs/html directory. This content is published on the root of
the website. the website.
Note that this build job does not create a root-marker file, Note that this build job does not create a root-marker file,
this has to be done by scripts called from tox. this has to be done by scripts called from tox.
parent: openstack-tox parent: openstack-tox
nodeset: ubuntu-bionic nodeset: ubuntu-bionic
success-url: publish-docs/ success-url: publish-docs/html/
post-run: playbooks/build-manuals-tox/post.yaml post-run: playbooks/build-manuals-tox/post.yaml
roles: roles:
- zuul: zuul/zuul-jobs - zuul: zuul/zuul-jobs

View File

@ -2,5 +2,4 @@
roles: roles:
- role: fetch-tox-output - role: fetch-tox-output
- role: fetch-sphinx-output - role: fetch-sphinx-output
sphinx_output_dir: 'publish-docs' sphinx_build_dir: 'publish-docs'
sphinx_build_dir: ''

View File

@ -1,6 +1,6 @@
#!/bin/bash -e #!/bin/bash -e
mkdir -p publish-docs mkdir -p publish-docs/html
# Set this to a sensible value if not set by OpenStack CI. # Set this to a sensible value if not set by OpenStack CI.
if [ -z "$ZUUL_BRANCH" ] ; then if [ -z "$ZUUL_BRANCH" ] ; then
@ -43,5 +43,5 @@ done
# For master, just mark the root # For master, just mark the root
if [ "$ZUUL_BRANCH" = "master" ] ; then if [ "$ZUUL_BRANCH" = "master" ] ; then
echo $MARKER_TEXT > publish-docs/.root-marker echo $MARKER_TEXT > publish-docs/html/.root-marker
fi fi

View File

@ -17,7 +17,7 @@ DIRECTORY=$1
if [ -z "$DIRECTORY" ] ; then if [ -z "$DIRECTORY" ] ; then
echo "usage $0 DIRECTORY options" echo "usage $0 DIRECTORY options"
echo "Options are:" echo "Options are:"
echo "--target TARGET: Copy files to publish-docs/$TARGET" echo "--target TARGET: Copy files to publish-docs/html/$TARGET"
echo "--build BUILD: Name of build directory" echo "--build BUILD: Name of build directory"
echo "--linkcheck: Check validity of links instead of building" echo "--linkcheck: Check validity of links instead of building"
echo "--pdf: PDF file generation" echo "--pdf: PDF file generation"
@ -88,9 +88,9 @@ else
# Copy RST (and PDF) # Copy RST (and PDF)
if [ "$TARGET" != "" ] ; then if [ "$TARGET" != "" ] ; then
mkdir -p publish-docs/$TARGET mkdir -p publish-docs/html/$TARGET
rsync -a $BUILD_DIR/ publish-docs/$TARGET/ rsync -a $BUILD_DIR/ publish-docs/html/$TARGET/
# Remove unneeded build artefact # Remove unneeded build artefact
rm -f publish-docs/$TARGET/.buildinfo rm -f publish-docs/html/$TARGET/.buildinfo
fi fi
fi fi

View File

@ -19,7 +19,7 @@ if [[ -z "$PUBLISH" ]] ; then
exit 1 exit 1
fi fi
mkdir -p publish-docs mkdir -p publish-docs/html
# Build all RST guides including PDF files # Build all RST guides including PDF files
tools/build-all-rst.sh --pdf tools/build-all-rst.sh --pdf
@ -28,22 +28,22 @@ tools/build-all-rst.sh --pdf
# www/www-index.html. # www/www-index.html.
if [ "$PUBLISH" = "build" ] ; then if [ "$PUBLISH" = "build" ] ; then
python3 tools/www-generator.py --source-directory www/ \ python3 tools/www-generator.py --source-directory www/ \
--output-directory publish-docs/www/ --output-directory publish-docs/html/www/
rsync -a www/static/ publish-docs/www/ rsync -a www/static/ publish-docs/html/www/
# publish-docs/www-index.html is the trigger for openstack-indexpage # publish-docs/html/www-index.html is the trigger for openstack-indexpage
# to include the file. # to include the file.
mv publish-docs/www/www-index.html publish-docs/www-index.html mv publish-docs/html/www/www-index.html publish-docs/html/www-index.html
fi fi
if [ "$PUBLISH" = "publish" ] ; then if [ "$PUBLISH" = "publish" ] ; then
python3 tools/www-generator.py --source-directory www/ \ python3 tools/www-generator.py --source-directory www/ \
--output-directory publish-docs --publish --output-directory publish-docs/html --publish
rsync -a www/static/ publish-docs/ rsync -a www/static/ publish-docs/html/
# Don't publish these files # Don't publish these files
rm publish-docs/www-index.html rm publish-docs/html/www-index.html
rm publish-docs/redirect-tests.txt rm publish-docs/html/redirect-tests.txt
fi fi
if [ "$PUBLISH" = "build" ] ; then if [ "$PUBLISH" = "build" ] ; then
# Create index page for viewing # Create index page for viewing
openstack-indexpage publish-docs openstack-indexpage publish-docs/html
fi fi

View File

@ -1,9 +1,9 @@
#!/bin/bash -xe #!/bin/bash -xe
if [[ -d publish-docs/www/ ]]; then if [[ -d publish-docs/html/www/ ]]; then
output=publish-docs/www output=publish-docs/html/www
else else
output=publish-docs/ output=publish-docs/html/
fi fi
.tox/checkbuild/bin/python tools/www-generator.py --verbose --source-directory www/ \ .tox/checkbuild/bin/python tools/www-generator.py --verbose --source-directory www/ \
@ -12,8 +12,8 @@ fi
if [[ $? -eq 0 ]]; then if [[ $? -eq 0 ]]; then
rsync -a www/static/ $output rsync -a www/static/ $output
fi fi
# publish-docs/www-index.html is the trigger for openstack-indexpage # publish-docs/html/www-index.html is the trigger for openstack-indexpage
# to include the file. # to include the file.
#mv publish-docs/www/www-index.html publish-docs/www-index.html #mv publish-docs/html/www/www-index.html publish-docs/html/www-index.html
.tox/checkbuild/bin/whereto $output/.htaccess $output/redirect-tests.txt .tox/checkbuild/bin/whereto $output/.htaccess $output/redirect-tests.txt

View File

@ -127,7 +127,7 @@ def parse_command_line_arguments():
parser.add_argument("--source-directory", type=str, parser.add_argument("--source-directory", type=str,
default='www', help='Set source directory.') default='www', help='Set source directory.')
parser.add_argument("--output-directory", type=str, parser.add_argument("--output-directory", type=str,
default='publish-docs/www', default='publishdocs/html/www',
help='Set output directory.') help='Set output directory.')
parser.add_argument("--check-all-links", action="store_true", parser.add_argument("--check-all-links", action="store_true",
default=False, default=False,

12
tox.ini
View File

@ -32,7 +32,7 @@ commands =
[testenv:checkbuild] [testenv:checkbuild]
commands = commands =
{toxinidir}/tools/publishdocs.sh build {toxinidir}/tools/publishdocs.sh build
whereto publish-docs/www/.htaccess publish-docs/www/redirect-tests.txt whereto publish-docs/html/www/.htaccess publish-docs/html/www/redirect-tests.txt
[testenv:docs] [testenv:docs]
commands = commands =
@ -60,6 +60,11 @@ commands =
whitelist_externals = doc-tools-check-languages whitelist_externals = doc-tools-check-languages
commands = commands =
doc-tools-check-languages doc-tools-check-languages.conf test all doc-tools-check-languages doc-tools-check-languages.conf test all
# Move from publish-docs to publish-docs/html
# TODO(AJaeger): Remove once openstack-doc-tools is updated
mkdir publish-docs-new
mv publish-docs publish-docs-new/html
mv publish-docs-new publish-docs
[testenv:buildlang] [testenv:buildlang]
# Run as "tox -e buildlang -- $LANG" # Run as "tox -e buildlang -- $LANG"
@ -71,6 +76,11 @@ commands =
whitelist_externals = doc-tools-check-languages whitelist_externals = doc-tools-check-languages
commands = commands =
doc-tools-check-languages doc-tools-check-languages.conf publish all doc-tools-check-languages doc-tools-check-languages.conf publish all
# Move from publish-docs to publish-docs/html
# TODO(AJaeger): Remove once openstack-doc-tools is updated
mkdir publish-docs-new
mv publish-docs publish-docs-new/html
mv publish-docs-new publish-docs
[testenv:generatepot-rst] [testenv:generatepot-rst]
# Generate POT files for translation, needs {posargs} like: # Generate POT files for translation, needs {posargs} like: