From 1d08a657f6ffb6a609eae89053a66a6bff38d573 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Fri, 16 Aug 2019 16:46:43 +0200 Subject: [PATCH] Simplify publishdocs et al We don't have different content for build and publish, so can cleanup our scripts and remove any special handling. Remove also usage of www-index.html. Change-Id: If1a9d9a2dddbf7cdf9fd4c01d22530f2cd181907 --- tools/publishdocs.sh | 35 ++++++----------------------------- tools/test.sh | 3 --- tools/www-generator.py | 22 ---------------------- tox.ini | 2 +- www/www-index.html | 12 ------------ 5 files changed, 7 insertions(+), 67 deletions(-) delete mode 100644 www/www-index.html diff --git a/tools/publishdocs.sh b/tools/publishdocs.sh index d98cba00ef..d700a79874 100755 --- a/tools/publishdocs.sh +++ b/tools/publishdocs.sh @@ -12,38 +12,15 @@ # License for the specific language governing permissions and limitations # under the License. -PUBLISH=$1 - -if [[ -z "$PUBLISH" ]] ; then - echo "usage $0 (publish|build)" - exit 1 -fi - mkdir -p publish-docs/html # Build all RST guides including PDF files tools/build-all-rst.sh --pdf -# Build the www pages so that openstack-indexpage creates a link to -# www/www-index.html. -if [ "$PUBLISH" = "build" ] ; then - python3 tools/www-generator.py --source-directory www/ \ - --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/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/html --publish - rsync -a www/static/ publish-docs/html/ - # Don't publish these files - rm publish-docs/html/www-index.html - rm -rf publish-docs/html/project-data -fi +# Build website +python3 tools/www-generator.py --source-directory www/ \ + --output-directory publish-docs/html --publish +rsync -a www/static/ publish-docs/html/ -if [ "$PUBLISH" = "build" ] ; then - # Create index page for viewing - openstack-indexpage publish-docs/html -fi +# Don't publish these files +rm -rf publish-docs/html/project-data diff --git a/tools/test.sh b/tools/test.sh index 14301f97fa..8cce818803 100755 --- a/tools/test.sh +++ b/tools/test.sh @@ -12,8 +12,5 @@ fi if [[ $? -eq 0 ]]; then rsync -a www/static/ $output fi -# publish-docs/html/www-index.html is the trigger for openstack-indexpage -# to include the file. -#mv publish-docs/html/www/www-index.html publish-docs/html/www-index.html .tox/publishdocs/bin/whereto $output/.htaccess $output/redirect-tests.txt diff --git a/tools/www-generator.py b/tools/www-generator.py index 7838b631b0..edd6f937c4 100755 --- a/tools/www-generator.py +++ b/tools/www-generator.py @@ -602,18 +602,12 @@ def main(): # Render the templates. output_pages = [] - page_list_template = None template_files = environment.list_templates() for template_file in template_files: if (template_file.startswith('static/') or template_file.startswith('templates/')): logger.info('ignoring %s', template_file) continue - if template_file.endswith('www-index.html'): - # Process this one at the end, so we have the full list of - # other output files. - page_list_template = template_file - continue render_template( environment, project_data, @@ -626,22 +620,6 @@ def main(): ) output_pages.append(template_file) - if page_list_template is not None: - output_pages.sort() - render_template( - environment, - project_data, - regular_repos, - infra_repos, - template_files, - page_list_template, - args.output_directory, - args.publish, - extra={ - 'file_list': output_pages, - }, - ) - return 0 diff --git a/tox.ini b/tox.ini index a50665fe18..9d13967f9f 100644 --- a/tox.ini +++ b/tox.ini @@ -49,7 +49,7 @@ commands = # published on docs.openstack.org with just copying publish-docs/* # over. commands = - {toxinidir}/tools/publishdocs.sh publish + {toxinidir}/tools/publishdocs.sh whereto publish-docs/html/.htaccess publish-docs/html/redirect-tests.txt rm publish-docs/html/redirect-tests.txt diff --git a/www/www-index.html b/www/www-index.html deleted file mode 100644 index 3ad64b2ccd..0000000000 --- a/www/www-index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - -