5 export PATH=$PATH:/usr/local/bin/
13 sphinx-build -b html -E -c etc/ design_docs/ build/
20 # NOTE: make sure source parameters for GS paths are not empty.
21 [[ $GERRIT_CHANGE_NUMBER =~ .+ ]]
22 [[ $GERRIT_PROJECT =~ .+ ]]
23 [[ $GERRIT_BRANCH =~ .+ ]]
25 gs_path_review="artifacts.opnfv.org/review/$GERRIT_CHANGE_NUMBER"
26 if [[ $GERRIT_BRANCH = "master" ]] ; then
27 gs_path_branch="artifacts.opnfv.org/$GERRIT_PROJECT"
29 gs_path_branch="artifacts.opnfv.org/$GERRIT_PROJECT/${{GERRIT_BRANCH##*/}}"
32 if [[ $JOB_NAME =~ "verify" ]] ; then
33 gsutil cp -r build/* "gs://$gs_path_review/"
35 echo "Document is available at http://$gs_path_review/index.html"
36 # post link to gerrit as comment
37 gerrit_comment=$(echo '"Document is available at 'http://$gs_path_review/index.html' for review"')
38 ssh -p 29418 gerrit.opnfv.org gerrit review -p $GERRIT_PROJECT -m \
39 $gerrit_comment $GERRIT_PATCHSET_REVISION
41 gsutil cp -r build/* "gs://$gs_path_branch/design_docs/"
42 #gsutil cp -r build/design_docs "gs://$gs_path_branch/"
43 #gsutil cp -r build/requirements/html "gs://$gs_path_branch/"
44 #gsutil cp -r build/requirements/latex/*.pdf "gs://$gs_path_branch/"
47 echo "Latest document is available at http://$gs_path_branch/design_docs/index.html"
49 if gsutil ls "gs://$gs_path_review" > /dev/null 2>&1 ; then
51 echo "Deleting Out-of-dated Documents..."
52 gsutil rm -r "gs://$gs_path_review"