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
This commit is contained in:
Andreas Jaeger 2019-08-16 16:46:43 +02:00
parent adc92586c9
commit 1d08a657f6
5 changed files with 7 additions and 67 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1,12 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<body>
<!-- TEMPLATE_FILE: openstack-manuals/www/{{TEMPLATE_FILE}} -->
<ul>
{% for outfile in file_list %}
<li><a href="www/{{outfile}}">{{outfile}}</a></li>
{% endfor %}
</ul>
</body>
</html>