openstack-doc-tools/bin/build-ha-guide.sh
Andreas Jaeger 05f9428303 Rework repository to make it an installable python package
This is an overhaul of the complete content to make it
a separate python package that can be installed on the jenkins
machines as well as on editor's machines.

The goal of this patchset is to package everything
and get the command "openstack-doc-test" running so that
it can be used for gating.

This will need further refinement for the other commands.

Change-Id: Icc2f1807dd5ab5fb2f83c05d1b3895b3a9a0dbaf
2013-12-14 22:53:18 +01:00

26 lines
1022 B
Bash
Executable File

#!/bin/bash
# This script needs to be called from the doc/high-availibilty-guide
# directory!
# Find location of db4-upgrade-xsl:
if [ -e /usr/share/xml/docbook/stylesheet/docbook5/db4-upgrade.xsl ] ; then
DB_UPGRADE=/usr/share/xml/docbook/stylesheet/docbook5/db4-upgrade.xsl
elif [ -e /usr/share/xml/docbook/stylesheet/upgrade/db4-upgrade.xsl ] ; then
DB_UPGRADE=/usr/share/xml/docbook/stylesheet/upgrade/db4-upgrade.xsl
else
echo "db4-upgrade.xsl not found"
exit 1
fi
type -P asciidoc > /dev/null 2>&1 || { echo >&2 "asciidoc not installed. Aborting."; exit 1; }
type -P xsltproc > /dev/null 2>&1 || { echo >&2 "xsltproc not installed. Aborting."; exit 1; }
type -P xmllint > /dev/null 2>&1 || { echo >&2 "xmllint not installed. Aborting."; exit 1; }
asciidoc -b docbook -d book -o - ha-guide.txt | \
xsltproc -o - $DB_UPGRADE - | \
xmllint --format - | \
sed -e 's,<book,<book xml:id="bk-ha-guide",' | \
sed -e 's,<info,<?rax pdf.url="../openstack-ha-guide-trunk.pdf"?><info,' \
> bk-ha-guide.xml