From 741d59c459bb732ebc2dc89d446136b7ec08083d Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Wed, 14 Aug 2019 20:28:25 +0200 Subject: [PATCH] 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 --- .zuul.yaml | 4 ++-- playbooks/build-manuals-tox/post.yaml | 3 +-- tools/build-all-rst.sh | 4 ++-- tools/build-rst.sh | 8 ++++---- tools/publishdocs.sh | 20 ++++++++++---------- tools/test.sh | 10 +++++----- tools/www-generator.py | 2 +- tox.ini | 12 +++++++++++- 8 files changed, 36 insertions(+), 27 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index e6b81715b2..301a1c8f00 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -9,14 +9,14 @@ description: | Base job to build manual related documents. These build jobs 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. Note that this build job does not create a root-marker file, this has to be done by scripts called from tox. parent: openstack-tox nodeset: ubuntu-bionic - success-url: publish-docs/ + success-url: publish-docs/html/ post-run: playbooks/build-manuals-tox/post.yaml roles: - zuul: zuul/zuul-jobs diff --git a/playbooks/build-manuals-tox/post.yaml b/playbooks/build-manuals-tox/post.yaml index 88b6d17e96..c5cca53960 100644 --- a/playbooks/build-manuals-tox/post.yaml +++ b/playbooks/build-manuals-tox/post.yaml @@ -2,5 +2,4 @@ roles: - role: fetch-tox-output - role: fetch-sphinx-output - sphinx_output_dir: 'publish-docs' - sphinx_build_dir: '' + sphinx_build_dir: 'publish-docs' diff --git a/tools/build-all-rst.sh b/tools/build-all-rst.sh index ad878f8613..a9fd5df735 100755 --- a/tools/build-all-rst.sh +++ b/tools/build-all-rst.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -mkdir -p publish-docs +mkdir -p publish-docs/html # Set this to a sensible value if not set by OpenStack CI. if [ -z "$ZUUL_BRANCH" ] ; then @@ -43,5 +43,5 @@ done # For master, just mark the root if [ "$ZUUL_BRANCH" = "master" ] ; then - echo $MARKER_TEXT > publish-docs/.root-marker + echo $MARKER_TEXT > publish-docs/html/.root-marker fi diff --git a/tools/build-rst.sh b/tools/build-rst.sh index 06eadada55..02c5b31742 100755 --- a/tools/build-rst.sh +++ b/tools/build-rst.sh @@ -17,7 +17,7 @@ DIRECTORY=$1 if [ -z "$DIRECTORY" ] ; then echo "usage $0 DIRECTORY options" 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 "--linkcheck: Check validity of links instead of building" echo "--pdf: PDF file generation" @@ -88,9 +88,9 @@ else # Copy RST (and PDF) if [ "$TARGET" != "" ] ; then - mkdir -p publish-docs/$TARGET - rsync -a $BUILD_DIR/ publish-docs/$TARGET/ + mkdir -p publish-docs/html/$TARGET + rsync -a $BUILD_DIR/ publish-docs/html/$TARGET/ # Remove unneeded build artefact - rm -f publish-docs/$TARGET/.buildinfo + rm -f publish-docs/html/$TARGET/.buildinfo fi fi diff --git a/tools/publishdocs.sh b/tools/publishdocs.sh index 5214712f4f..6c4f98c26e 100755 --- a/tools/publishdocs.sh +++ b/tools/publishdocs.sh @@ -19,7 +19,7 @@ if [[ -z "$PUBLISH" ]] ; then exit 1 fi -mkdir -p publish-docs +mkdir -p publish-docs/html # Build all RST guides including PDF files tools/build-all-rst.sh --pdf @@ -28,22 +28,22 @@ tools/build-all-rst.sh --pdf # www/www-index.html. if [ "$PUBLISH" = "build" ] ; then python3 tools/www-generator.py --source-directory www/ \ - --output-directory publish-docs/www/ - rsync -a www/static/ publish-docs/www/ - # publish-docs/www-index.html is the trigger for openstack-indexpage + --output-directory publish-docs/html/www/ + rsync -a www/static/ publish-docs/html/www/ + # publish-docs/html/www-index.html is the trigger for openstack-indexpage # 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 if [ "$PUBLISH" = "publish" ] ; then python3 tools/www-generator.py --source-directory www/ \ - --output-directory publish-docs --publish - rsync -a www/static/ publish-docs/ + --output-directory publish-docs/html --publish + rsync -a www/static/ publish-docs/html/ # Don't publish these files - rm publish-docs/www-index.html - rm publish-docs/redirect-tests.txt + rm publish-docs/html/www-index.html + rm publish-docs/html/redirect-tests.txt fi if [ "$PUBLISH" = "build" ] ; then # Create index page for viewing - openstack-indexpage publish-docs + openstack-indexpage publish-docs/html fi diff --git a/tools/test.sh b/tools/test.sh index 91be5697ae..912cf1fed0 100755 --- a/tools/test.sh +++ b/tools/test.sh @@ -1,9 +1,9 @@ #!/bin/bash -xe -if [[ -d publish-docs/www/ ]]; then - output=publish-docs/www +if [[ -d publish-docs/html/www/ ]]; then + output=publish-docs/html/www else - output=publish-docs/ + output=publish-docs/html/ fi .tox/checkbuild/bin/python tools/www-generator.py --verbose --source-directory www/ \ @@ -12,8 +12,8 @@ fi if [[ $? -eq 0 ]]; then rsync -a www/static/ $output 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. -#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 diff --git a/tools/www-generator.py b/tools/www-generator.py index 19626015bd..7838b631b0 100755 --- a/tools/www-generator.py +++ b/tools/www-generator.py @@ -127,7 +127,7 @@ def parse_command_line_arguments(): parser.add_argument("--source-directory", type=str, default='www', help='Set source directory.') parser.add_argument("--output-directory", type=str, - default='publish-docs/www', + default='publishdocs/html/www', help='Set output directory.') parser.add_argument("--check-all-links", action="store_true", default=False, diff --git a/tox.ini b/tox.ini index 6f429f806f..fbb2031e30 100644 --- a/tox.ini +++ b/tox.ini @@ -32,7 +32,7 @@ commands = [testenv:checkbuild] commands = {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] commands = @@ -60,6 +60,11 @@ commands = whitelist_externals = doc-tools-check-languages commands = 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] # Run as "tox -e buildlang -- $LANG" @@ -71,6 +76,11 @@ commands = whitelist_externals = doc-tools-check-languages commands = 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] # Generate POT files for translation, needs {posargs} like: