jjb: fix dirs to upload gs in doc builder jobs 53/3653/1
authorRyota MIBU <r-mibu@cq.jp.nec.com>
Thu, 26 Nov 2015 12:26:23 +0000 (21:26 +0900)
committerRyota MIBU <r-mibu@cq.jp.nec.com>
Thu, 26 Nov 2015 12:26:23 +0000 (21:26 +0900)
Change-Id: I0a1e899179ad0ab5b5b662bee6214487e84e1fe7
Signed-off-by: Ryota MIBU <r-mibu@cq.jp.nec.com>
jjb/releng-macros.yaml

index 1f091b9..9848eed 100644 (file)
             echo "###########################"
             echo
 
-            gs_path="artifacts.opnfv.org/review/$GERRIT_CHANGE_NUMBER"
+            gs_base="artifacts.opnfv.org/review"
+            gs_path="$gs_base/$GERRIT_CHANGE_NUMBER"
+            local_path="docs/$GERRIT_CHANGE_NUMBER"
 
-            gsutil -m cp -r docs/output "gs://$gs_path"
+            mv docs/output "$local_path"
+            gsutil -m cp -r "$local_path" "gs://$gs_base"
 
             if gsutil ls "gs://$gs_path" | grep -e 'html$' > /dev/null 2>&1 ; then
                 gsutil -m setmeta \
             fi
 
             echo "Document link(s):" >> gerrit_comment.txt
-            find docs/output | grep -e 'index.html$' -e 'pdf$' | \
-                sed -e "s|^docs/output|    http://$gs_path|" >> gerrit_comment.txt
+            find "$local_path" | grep -e 'index.html$' -e 'pdf$' | \
+                sed -e "s|^$local_path|    http://$gs_path|" >> gerrit_comment.txt
 
 - builder:
     name: upload-merged-docs-to-opnfv-artifacts
             echo
 
             if [[ "$GERRIT_BRANCH" == "master" ]] ; then
-                gs_path="artifacts.opnfv.org/$GERRIT_PROJECT/docs"
+                gs_base="artifacts.opnfv.org/$GERRIT_PROJECT"
             else
-                gs_path="artifacts.opnfv.org/$GERRIT_PROJECT/$GERRIT_BRANCH/docs"
+                gs_base="artifacts.opnfv.org/$GERRIT_PROJECT/$GERRIT_BRANCH"
             fi
+            gs_path="$gs_base/docs"
+            local_path="docs/docs"
 
-            gsutil -m cp -r docs/output/* "gs://$gs_path"
+            mv docs/output "$local_path"
+            gsutil -m cp -r "$local_path" "gs://$gs_base"
 
             if gsutil ls "gs://$gs_path" | grep -e 'html$' > /dev/null 2>&1 ; then
                 gsutil -m setmeta \
             fi
 
             echo "Document link(s):" >> gerrit_comment.txt
-            find docs/output | grep -e 'index.html$' -e 'pdf$' | \
-                sed -e "s|^docs/output|    http://$gs_path|" >> gerrit_comment.txt
+            find "$local_path" | grep -e 'index.html$' -e 'pdf$' | \
+                sed -e "s|^$local_path|    http://$gs_path|" >> gerrit_comment.txt
 
 - builder:
     name: report-docs-build-result-to-gerrit