Bake in oslo sample config generation to sphinx build

The expectation from users is that to build docs locally all you need
to do is run build_sphinx on the repo and the docs will be fully
created. When we added the sample config to the tempest docs we ignored
this and just added the sample config generation to the docs tox job.
This commit fixes this by baking in the sample config generation to
the sphinx conf.py file which should ensure we have the sample config
generated every time that we call build_sphinx.

Change-Id: Ifd570707847f52592f5bc9bc743b8d3c98512639
This commit is contained in:
Matthew Treinish 2015-08-10 11:51:54 -04:00
parent c6170a0321
commit 13ed69fffc
No known key found for this signature in database
GPG Key ID: FD12A0F214C9E177
2 changed files with 13 additions and 1 deletions

View File

@ -13,6 +13,19 @@
import sys
import os
import subprocess
# Build a tempest sample config file:
def build_sample_config(app):
root_dir = os.path.dirname(
os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
subprocess.call(["oslo-config-generator", "--config-file",
"tools/config/config-generator.tempest.conf",
"--output-file", "doc/source/_static/tempest.conf"],
cwd=root_dir)
def setup(app):
app.connect('builder-inited', build_sample_config)
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the

View File

@ -110,7 +110,6 @@ commands = {posargs}
[testenv:docs]
# The sample config file we generate is included in the sphinxdoc, so build that first.
commands =
oslo-config-generator --config-file tools/config/config-generator.tempest.conf --output-file doc/source/_static/tempest.conf
python setup.py build_sphinx {posargs}
[testenv:pep8]