fix pre-hook 69/17469/2
authorRyota MIBU <r-mibu@cq.jp.nec.com>
Mon, 25 Jul 2016 01:59:18 +0000 (10:59 +0900)
committerRyota MIBU <r-mibu@cq.jp.nec.com>
Mon, 25 Jul 2016 02:22:01 +0000 (11:22 +0900)
- execute pre-hook after required python package installed

- remove execution flag of docs/pre-hook.sh as it's unnecessary

- add howto document regarding 'Hooks'

Change-Id: Ib94888b018347ce8660d53db93dba3586c098948
Signed-off-by: Ryota MIBU <r-mibu@cq.jp.nec.com>
docs/how-to-use-docs/documentation-example.rst
scripts/docs-build.sh

index 85133ad..bbd7109 100644 (file)
@@ -255,3 +255,11 @@ document build.
 
 .. _opnfvdocs/scripts/docs-build.sh:
     https://gerrit.opnfv.org/gerrit/gitweb?p=opnfvdocs.git;a=blob;f=scripts/docs-build.sh;
+
+Hooks
+=====
+
+The document builder script supports pre-hook. If you need to execute some
+commands before starting to build process (e.g. generate API rst from codes),
+create '<your repo>/docs/pre-hook.sh' which will be executed (using 'source')
+once before all document build start.
index afa68ec..043fd1b 100755 (executable)
@@ -190,13 +190,12 @@ fi
 
 virtualenv "$VENV_DIR"
 source "$VENV_DIR/bin/activate"
+pip install -r "$OPNFVDOCS_DIR/etc/requirements.txt"
 
 if [ -e "$DOCS_DIR/pre-hook.sh" ]; then
     source "$DOCS_DIR/pre-hook.sh"
 fi
 
-pip install -r "$OPNFVDOCS_DIR/etc/requirements.txt"
-
 find $DOCS_DIR -name $INDEX_RST -printf '%h\n' | while read dir
 do
     name=$(generate_name $dir)