Setup ha-guide infrastructure

Add files for building and testing.
This commit is contained in:
Andreas Jaeger 2014-09-15 19:40:07 +02:00
parent 149c3b3beb
commit c6bf631ce7
16 changed files with 47978 additions and 0 deletions

24
.gitignore vendored Normal file
View File

@ -0,0 +1,24 @@
.DS_Store
*.xpr
# Packages
.venv
*.egg
*.egg-info
# Testenvironment
.tox
# Build directories
target/
publish-docs/
generated/
/build-*.log.gz
# Transifex Client Setting
.tx
# Editors
*~
.*.swp
.bak

4
.gitreview Normal file
View File

@ -0,0 +1,4 @@
[gerrit]
host=review.openstack.org
port=29418
project=openstack/ha-guide.git

108
README.rst Normal file
View File

@ -0,0 +1,108 @@
OpenStack Manuals
+++++++++++++++++
This repository contains documentation for the OpenStack project.
For more details, see the `OpenStack Documentation wiki page
<http://wiki.openstack.org/Documentation>`_.
It includes these manuals:
* Admin User Guide
* Architecture Design Guide
* Cloud Administrator Guide
* Command-Line Interface Reference
* Configuration Reference
* End User Guide
* High Availability Guide
* Installation Guides
* Virtual Machine Image Guide
In addition to the guides, this repository contains:
* docs.openstack.org: ``www``
Prerequisites
=============
`Apache Maven <http://maven.apache.org/>`_ must be installed to build the
documentation.
To install Maven 3 for Ubuntu 12.04 and later, and Debian wheezy and later::
apt-get install maven
On Fedora 20 and later::
yum install maven
Building
========
The different manuals are in subdirectories of the
``openstack-manuals/doc/`` directory.
For example, the root directory of the *OpenStack User Guide*
is ``openstack-manuals/doc/user-guide``.
To build a specific guide, look for a ``pom.xml`` file within a subdirectory,
then run the ``mvn`` command in that directory. For example::
cd openstack-manuals/doc/user-guide/
mvn clean generate-sources
The generated PDF documentation file is::
openstack-manuals/doc/user-guide/target/docbkx/webhelp/user-guide.pdf
The root of the generated HTML documentation is::
openstack-manuals/doc/user-guide/target/docbkx/webhelp/user-guide/content/index.html
Testing of changes and building of the manual
=============================================
Install the python tox package and run ``tox`` from the top-level
directory to use the same tests that are done as part of our Jenkins
gating jobs.
If you like to run individual tests, run:
* ``tox -e checkniceness`` - to run the niceness tests
* ``tox -e checksyntax`` - to run syntax checks
* ``tox -e checkdeletions`` - to check that no deleted files are referenced
* ``tox -e checkbuild`` - to actually build the manual
tox will use the openstack-doc-tools package for execution of these
tests.
Contributing
============
Our community welcomes all people interested in open source cloud
computing, and encourages you to join the `OpenStack Foundation
<http://www.openstack.org/join>`_.
The best way to get involved with the community is to talk with others
online or at a meet up and offer contributions through our processes,
the `OpenStack wiki <http://wiki.openstack.org>`_, blogs, or on IRC at
``#openstack`` on ``irc.freenode.net``.
We welcome all types of contributions, from blueprint designs to
documentation to testing to deployment scripts.
If you would like to contribute to the documents, please see the
`Documentation HowTo <https://wiki.openstack.org/wiki/Documentation/HowTo>`_.
Bugs
====
Bugs should be filed on Launchpad, not GitHub:
https://bugs.launchpad.net/openstack-manuals
Installing
==========
Refer to http://docs.openstack.org to see where these documents are published
and to learn more about the OpenStack project.

3
doc-test.conf Normal file
View File

@ -0,0 +1,3 @@
[DEFAULT]
repo_name = ha-guide

View File

@ -0,0 +1,18 @@
# Example configuration for the languages 'ja' and 'fr'.
# directories to be set up
declare -A DIRECTORIES=(
["ja"]="high-availability-guide glossary"
)
# books to be built
declare -A BOOKS=(
["ja"]="high-availability-guide"
)
# Where does the top-level pom live?
# Set to empty to not copy it.
POM_FILE=""
# Location of doc dir
DOC_DIR="doc/"

7
doc/glossary/README.rst Normal file
View File

@ -0,0 +1,7 @@
Important note about glossary
=============================
This directory is synced from openstack-manuals. If you need to make
changes, make the changes in openstack-manuals/doc/glossary. After any
change merged to openstack-manuals/doc/glossary, automatically a patch
for this directory will be proposed.

File diff suppressed because it is too large Load Diff

8127
doc/glossary/locale/de.po Normal file

File diff suppressed because it is too large Load Diff

8128
doc/glossary/locale/fr.po Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

8127
doc/glossary/locale/ja.po Normal file

File diff suppressed because it is too large Load Diff

8126
doc/glossary/locale/ko_KR.po Normal file

File diff suppressed because it is too large Load Diff

47
doc/pom.xml Normal file
View File

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.openstack.docs</groupId>
<artifactId>parent-pom</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>glossary</module>
<module>high-availability-guide</module>
</modules>
<profiles>
<profile>
<id>Rackspace Research Repositories</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>rackspace-research</id>
<name>Rackspace Research Repository</name>
<url>http://maven.research.rackspacecloud.com/content/groups/public/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>rackspace-research</id>
<name>Rackspace Research Repository</name>
<url>http://maven.research.rackspacecloud.com/content/groups/public/</url>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>com.rackspace.cloud.api</groupId>
<artifactId>clouddocs-maven-plugin</artifactId>
<version>2.1.2</version>
</plugin>
</plugins>
</build>
</project>

5
test-requirements.txt Normal file
View File

@ -0,0 +1,5 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
openstack-doc-tools>=0.18.1

91
tools/generatepot Executable file
View File

@ -0,0 +1,91 @@
#!/usr/bin/env python
'''
Created on 2012-7-3
@author: daisy
'''
import os, sys
from xml2po import Main
from xml2po.modes.docbook import docbookXmlMode
class myDocbookXmlMode(docbookXmlMode):
def __init__(self):
self.lists = ['itemizedlist', 'orderedlist', 'variablelist',
'segmentedlist', 'simplelist', 'calloutlist', 'varlistentry', 'userinput',
'computeroutput','prompt','command','screen']
self.objects = [ 'figure', 'textobject', 'imageobject', 'mediaobject',
'screenshot','literallayout', 'programlisting' ]
default_mode = 'docbook'
operation = 'pot'
options = {
'mark_untranslated' : False,
'expand_entities' : True,
'expand_all_entities' : False,
}
ignore_folder = {"docbkx-example", "training-guide"}
ignore_file = {"api-examples.xml"}
root = "./doc"
def generatePoT (folder):
if (folder==None) :
path = root
else :
generateSinglePoT(folder)
return
if (not os.path.isdir(path)) :
return
files = os.listdir(path)
for aFile in files :
if (not (aFile in ignore_folder)):
generateSinglePoT (aFile)
def generateSinglePoT(folder):
xmlfiles = []
abspath = os.path.join(root, folder)
if (os.path.isdir(abspath)) :
os.path.walk(abspath, get_all_xml, xmlfiles)
else:
return
if len(xmlfiles)>0 :
output = os.path.join(abspath,"locale")
if (not os.path.exists(output)) :
os.mkdir(output)
output = os.path.join(output, folder+".pot")
try:
xml2po_main = Main(default_mode, operation, output, options)
xml2po_main.current_mode = myDocbookXmlMode()
except IOError:
print "Error: cannot open aFile %s for writing." % (output)
sys.exit(5)
#print(xmlfiles)
#print(">>>outout: %s ", output)
xml2po_main.to_pot(xmlfiles)
def get_all_xml (sms, dr, flst):
if ((flst == "target") or (flst == "wadls")) :
return
if (dr.find("target")>-1) :
return
if (dr.find("wadls")>-1) :
return
for f in flst:
if (f.endswith(".xml") and (f != "pom.xml") and (not (f in ignore_file))) :
sms.append(os.path.join(dr,f))
def main():
try:
folder = sys.argv[1]
except:
folder = None
generatePoT(folder)
if __name__ == '__main__':
main()

79
tox.ini Normal file
View File

@ -0,0 +1,79 @@
[tox]
minversion = 1.6
envlist = checkniceness,checksyntax,checkdeletions,checkbuild,checklang,checklinks
skipsdist = True
[testenv]
setenv =
VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/test-requirements.txt
whitelist_externals =
bash
cp
mkdir
rm
rsync
sed
[testenv:venv]
commands = {posargs}
[testenv:checklinks]
commands = openstack-doc-test --check-links {posargs}
[testenv:checkniceness]
commands =
openstack-doc-test --check-niceness {posargs}
doc8 doc
[testenv:checksyntax]
commands =
openstack-doc-test --check-syntax {posargs}
# Check that .po and .pot files are valid:
bash -c "find doc -type f -regex '.*\.pot?' -print0|xargs -0 -n 1 msgfmt --check-format -o /dev/null"
[testenv:checkdeletions]
commands = openstack-doc-test --check-deletions {posargs}
[testenv:checkbuild]
commands =
openstack-doc-test --check-build {posargs}
[testenv:publishdocs]
# Prepare all documents (except www subdir) so that they can get
# published on docs.openstack.org with just copying publish-docs/*
# over.
commands =
openstack-doc-test --check-build --publish
[testenv:checklang]
# Generatedocbook needs xml2po which cannot be installed
# in the venv. Since it's installed in the system, let's
# use sitepackages.
sitepackages=True
whitelist_externals = doc-tools-check-languages
commands = doc-tools-check-languages doc-tools-check-languages.conf test all
[testenv:buildlang]
# Run as "tox -e buildlang -- $LANG"
# Generatedocbook needs xml2po which cannot be installed
# in the venv. Since it's installed in the system, let's
# use sitepackages.
sitepackages=True
whitelist_externals = doc-tools-check-languages
commands = doc-tools-check-languages doc-tools-check-languages.conf test {posargs}
[testenv:publishlang]
# Generatedocbook needs xml2po which cannot be installed
# in the venv. Since it's installed in the system, let's
# use sitepackages.
sitepackages=True
whitelist_externals = doc-tools-check-languages
commands = doc-tools-check-languages doc-tools-check-languages.conf publish all
[doc8]
# Settings for doc8:
# Ignore target directories
ignore_path = doc/*/target
# File extensions to use
extensions = .rst,.txt