api-site/tools/build-index.sh
Andreas Jaeger 9d230819a6 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
2017-10-09 22:08:27 +02:00

48 lines
1.6 KiB
Bash
Executable File

#!/bin/bash -xe
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
PUBLISH=$1
if [[ -z "$PUBLISH" ]] ; then
echo "usage $0 (build|publish)"
exit 1
fi
mkdir -p publish-docs
# Build the www pages so that openstack-doc-test creates a link to
# www/www-index.html.
if [ "$PUBLISH" = "build" ] ; then
python 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-doc-test
# to include the file.
mv publish-docs/www/www-index.html publish-docs/www-index.html
# Create index page for viewing
openstack-indexpage publish-docs
fi
if [ "$PUBLISH" = "publish" ] ; then
python tools/www-generator.py --source-directory www/ \
--output-directory publish-docs/
rsync -a www/static/ publish-docs/
# Don't publish this file
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/.root-marker
fi