Handle www pages properly when publishing

www is copied to publish-dir/www but this is not desired when publishing
for our external website - only for drafts.

Add option --publish for publishing to external website
that does not copy www over and also always builds manuals.

Change-Id: I9972a690c6c714fbe028b47ff1da2884d058282b
This commit is contained in:
Andreas Jaeger 2014-04-17 05:18:21 +02:00
parent ee98d2a64d
commit cbd65025c9
3 changed files with 22 additions and 2 deletions

View File

@ -97,6 +97,13 @@ sufficient for many of the books.
Release notes
=============
0.11
----
* Add ``--publish`` option to ``openstack-doc-test`` that does not
publish the www directory to the wrong location.
* Improvements for generation of option tables.
0.10
----

View File

@ -77,6 +77,10 @@ OPTIONS
**--parallel**
Build books in parallel (default).
**--publish**
Setup content in publish-docs directory for publishing to
external website.
**--verbose**
Verbose execution.

View File

@ -1204,6 +1204,9 @@ cli_OPTS = [
help="Do not exit on failures."),
cfg.BoolOpt("parallel", default=True,
help="Build books in parallel (default)."),
cfg.BoolOpt("publish", default=False,
help="Setup content in publish-docs directory for "
"publishing to external website."),
cfg.BoolOpt('verbose', default=False, short='v',
help="Verbose execution."),
cfg.MultiStrOpt("build-file-exception",
@ -1290,6 +1293,9 @@ def handle_options():
CONF.check_build = True
CONF.check_niceness = True
if CONF.publish:
CONF.create_index = False
if CONF.check_build and CONF.book and CONF.target_dir:
if len(CONF.book) != len(CONF.target_dir):
print("ERROR: book and target_dir options need to have a 1:1 "
@ -1329,10 +1335,13 @@ def main():
elif not CONF.api_site:
doc_path = os.path.join(doc_path, 'doc')
if CONF.check_build and www_touched(False):
# Do not publish www directory if we build for external
# publishing
if (CONF.check_build and
(www_touched(False) and not CONF.publish)):
publish_www()
if not CONF.force and www_touched(True):
if not CONF.publish and not CONF.force and www_touched(True):
print("Only files in www directory changed, nothing to do.\n")
return