Use new version docu-build.sh 06/806/12
authorAric Gardner <agardner@linuxfoundation.org>
Thu, 11 Jun 2015 17:43:34 +0000 (13:43 -0400)
committerAric Gardner <agardner@linuxfoundation.org>
Thu, 11 Jun 2015 19:37:24 +0000 (15:37 -0400)
Update jobs to use new version docu-build.sh,
as well as cease using depreciated docu-verify.sh
These two are special cases and will be handled in a seperate commit.
./doctor/docu-build.sh
./genesis/docu-build.sh

Change-Id: I3e1d7750fce0a1e97e9c1904983e67189e0b8a32
Signed-off-by: Aric Gardner <agardner@linuxfoundation.org>
22 files changed:
jjb/copper/copper.yml
jjb/copper/docu-build.sh [new file with mode: 0644]
jjb/functest/docu-build.sh
jjb/functest/docu-verify.sh [deleted file]
jjb/functest/functest.yml
jjb/octopus/docu-build.sh
jjb/octopus/docu-verify.sh [deleted file]
jjb/octopus/octopus.yml
jjb/opnfvdocs/docu-build.sh
jjb/opnfvdocs/docu-verify.sh [deleted file]
jjb/parser/docu-build.sh
jjb/parser/docu-verify.sh [deleted file]
jjb/parser/parser.yml
jjb/pharos/docu-build.sh
jjb/pharos/docu-verify.sh [deleted file]
jjb/pharos/pharos.yml
jjb/prediction/docu-build.sh
jjb/prediction/docu-verify.sh [deleted file]
jjb/prediction/prediction.yml
jjb/promise/docu-build.sh
jjb/promise/docu-verify.sh [deleted file]
jjb/promise/promise.yml

index 9483d31..0a7f57d 100644 (file)
@@ -70,7 +70,8 @@
         - test-macro
 
     builders:
-        - shell: !include-raw ../opnfvdocs/docu-build.sh
+        - shell: 
+            !include-raw docu-build.sh
 
     postbuilders:
         - test-macro
                     branch-pattern: '**/master'
 
     builders:
-        - shell: !include-raw ../opnfvdocs/docu-verify.sh
+        - shell: 
+            !include-raw docu-build.sh
 
 
 - job-template:
                       branch-pattern: '**/master'
 
     builders:
-        - shell: !include-raw ../opnfvdocs/docu-build.sh
\ No newline at end of file
+        - shell: 
+            !include-raw docu-build.sh
diff --git a/jjb/copper/docu-build.sh b/jjb/copper/docu-build.sh
new file mode 100644 (file)
index 0000000..057cc97
--- /dev/null
@@ -0,0 +1,80 @@
+#!/bin/bash
+set -e
+set -o pipefail
+
+project="$(git remote -v | head -n1 | awk '{{print $2}}' | sed -e 's,.*:\(.*/\)\?,,' -e 's/\.git$//')"
+export PATH=$PATH:/usr/local/bin/
+
+git_sha1="$(git rev-parse HEAD)"
+docu_build_date="$(date)"
+
+if [[ $JOB_NAME =~ "verify" ]] ; then
+      patchset="/$GERRIT_CHANGE_NUMBER"
+fi
+
+files=()
+while read -r -d ''; do
+       files+=("$REPLY")
+done < <(find * -type f -iname '*.rst' -print0)
+
+for file in "${{files[@]}}"; do
+
+       file_cut="${{file%.*}}"
+       gs_cp_folder="${{file_cut}}"
+
+       # sed part
+       sed -i "s/_sha1_/$git_sha1/g" $file
+       sed -i "s/_date_/$docu_build_date/g" $file
+
+       # rst2html part
+       echo "rst2html $file"
+       rst2html $file | gsutil cp -L gsoutput.txt - \
+       gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".html
+       gsutil setmeta -h "Content-Type:text/html" \
+                       -h "Cache-Control:private, max-age=0, no-transform" \
+                       gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".html
+       cat gsoutput.txt
+       rm -f gsoutput.txt
+
+       echo "rst2pdf $file"
+       rst2pdf $file -o - | gsutil cp -L gsoutput.txt - \
+       gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".pdf
+       gsutil setmeta -h "Content-Type:application/pdf" \
+                       -h "Cache-Control:private, max-age=0, no-transform" \
+                       gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".pdf
+       cat gsoutput.txt
+       rm -f gsoutput.txt
+
+  links+="http://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".html \n"
+  links+="http://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".pdf \n"
+
+done
+
+images=()
+while read -r -d ''; do
+        images+=("$REPLY")
+done < <(find * -type f \( -iname \*.jpg -o -iname \*.png \) -print0)
+
+for img in "${{images[@]}}"; do
+
+       # uploading found images
+       echo "uploading $img"
+        cat "$img" | gsutil cp -L gsoutput.txt - \
+        gs://artifacts.opnfv.org/"$project""$patchset"/"$img"
+        gsutil setmeta -h "Content-Type:image/jpeg" \
+                        -h "Cache-Control:private, max-age=0, no-transform" \
+                        gs://artifacts.opnfv.org/"$project""$patchset"/"$img"
+        cat gsoutput.txt
+        rm -f gsoutput.txt
+
+done
+
+if [[ $GERRIT_EVENT_TYPE = "change-merged" ]] ; then
+    patchset="/$GERRIT_CHANGE_NUMBER"
+    if [ ! -z "$patchset" ]; then
+      gsutil rm gs://artifacts.opnfv.org/"$project""$patchset"/** || true
+    fi
+fi
+
+echo -e "$links"
+
index 499bdbe..057cc97 100644 (file)
@@ -8,6 +8,10 @@ export PATH=$PATH:/usr/local/bin/
 git_sha1="$(git rev-parse HEAD)"
 docu_build_date="$(date)"
 
+if [[ $JOB_NAME =~ "verify" ]] ; then
+      patchset="/$GERRIT_CHANGE_NUMBER"
+fi
+
 files=()
 while read -r -d ''; do
        files+=("$REPLY")
@@ -25,22 +29,25 @@ for file in "${{files[@]}}"; do
        # rst2html part
        echo "rst2html $file"
        rst2html $file | gsutil cp -L gsoutput.txt - \
-       gs://artifacts.opnfv.org/"$project"/"$gs_cp_folder".html
+       gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".html
        gsutil setmeta -h "Content-Type:text/html" \
                        -h "Cache-Control:private, max-age=0, no-transform" \
-                       gs://artifacts.opnfv.org/"$project"/"$gs_cp_folder".html
+                       gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".html
        cat gsoutput.txt
        rm -f gsoutput.txt
 
        echo "rst2pdf $file"
        rst2pdf $file -o - | gsutil cp -L gsoutput.txt - \
-       gs://artifacts.opnfv.org/"$project"/"$gs_cp_folder".pdf
+       gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".pdf
        gsutil setmeta -h "Content-Type:application/pdf" \
                        -h "Cache-Control:private, max-age=0, no-transform" \
-                       gs://artifacts.opnfv.org/"$project"/"$gs_cp_folder".pdf
+                       gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".pdf
        cat gsoutput.txt
        rm -f gsoutput.txt
 
+  links+="http://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".html \n"
+  links+="http://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".pdf \n"
+
 done
 
 images=()
@@ -53,11 +60,21 @@ for img in "${{images[@]}}"; do
        # uploading found images
        echo "uploading $img"
         cat "$img" | gsutil cp -L gsoutput.txt - \
-        gs://artifacts.opnfv.org/"$project"/"$img"
+        gs://artifacts.opnfv.org/"$project""$patchset"/"$img"
         gsutil setmeta -h "Content-Type:image/jpeg" \
                         -h "Cache-Control:private, max-age=0, no-transform" \
-                        gs://artifacts.opnfv.org/"$project"/"$img"
+                        gs://artifacts.opnfv.org/"$project""$patchset"/"$img"
         cat gsoutput.txt
         rm -f gsoutput.txt
 
 done
+
+if [[ $GERRIT_EVENT_TYPE = "change-merged" ]] ; then
+    patchset="/$GERRIT_CHANGE_NUMBER"
+    if [ ! -z "$patchset" ]; then
+      gsutil rm gs://artifacts.opnfv.org/"$project""$patchset"/** || true
+    fi
+fi
+
+echo -e "$links"
+
diff --git a/jjb/functest/docu-verify.sh b/jjb/functest/docu-verify.sh
deleted file mode 100644 (file)
index f337a7f..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/bash
-set -e
-set -o pipefail
-
-project="$(git remote -v | head -n1 | awk '{{print $2}}' | sed -e 's,.*:\(.*/\)\?,,' -e 's/\.git$//')"
-export PATH=$PATH:/usr/local/bin/
-
-git_sha1="$(git rev-parse HEAD)"
-docu_build_date="$(date)"
-
-files=()
-while read -r -d ''; do
-       files+=("$REPLY")
-done < <(find * -type f -iname '*.rst' -print0)
-
-for file in "${{files[@]}}"; do
-
-       file_cut="${{file%.*}}"
-       gs_cp_folder="${{file_cut}}"
-
-       # sed part
-       sed -i "s/_sha1_/$git_sha1/g" $file
-       sed -i "s/_date_/$docu_build_date/g" $file
-
-       # rst2html part
-       echo "rst2html $file"
-       rst2html $file > $file_cut".html"
-
-       echo "rst2pdf $file"
-       rst2pdf $file -o $file_cut".pdf"
-
-done
-
index f441594..824888e 100644 (file)
 
     builders:
         - shell:
-            !include-raw docu-verify.sh
+            !include-raw docu-build.sh
 
 - job-template:
     name: 'functest-merge'
index 499bdbe..057cc97 100644 (file)
@@ -8,6 +8,10 @@ export PATH=$PATH:/usr/local/bin/
 git_sha1="$(git rev-parse HEAD)"
 docu_build_date="$(date)"
 
+if [[ $JOB_NAME =~ "verify" ]] ; then
+      patchset="/$GERRIT_CHANGE_NUMBER"
+fi
+
 files=()
 while read -r -d ''; do
        files+=("$REPLY")
@@ -25,22 +29,25 @@ for file in "${{files[@]}}"; do
        # rst2html part
        echo "rst2html $file"
        rst2html $file | gsutil cp -L gsoutput.txt - \
-       gs://artifacts.opnfv.org/"$project"/"$gs_cp_folder".html
+       gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".html
        gsutil setmeta -h "Content-Type:text/html" \
                        -h "Cache-Control:private, max-age=0, no-transform" \
-                       gs://artifacts.opnfv.org/"$project"/"$gs_cp_folder".html
+                       gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".html
        cat gsoutput.txt
        rm -f gsoutput.txt
 
        echo "rst2pdf $file"
        rst2pdf $file -o - | gsutil cp -L gsoutput.txt - \
-       gs://artifacts.opnfv.org/"$project"/"$gs_cp_folder".pdf
+       gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".pdf
        gsutil setmeta -h "Content-Type:application/pdf" \
                        -h "Cache-Control:private, max-age=0, no-transform" \
-                       gs://artifacts.opnfv.org/"$project"/"$gs_cp_folder".pdf
+                       gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".pdf
        cat gsoutput.txt
        rm -f gsoutput.txt
 
+  links+="http://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".html \n"
+  links+="http://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".pdf \n"
+
 done
 
 images=()
@@ -53,11 +60,21 @@ for img in "${{images[@]}}"; do
        # uploading found images
        echo "uploading $img"
         cat "$img" | gsutil cp -L gsoutput.txt - \
-        gs://artifacts.opnfv.org/"$project"/"$img"
+        gs://artifacts.opnfv.org/"$project""$patchset"/"$img"
         gsutil setmeta -h "Content-Type:image/jpeg" \
                         -h "Cache-Control:private, max-age=0, no-transform" \
-                        gs://artifacts.opnfv.org/"$project"/"$img"
+                        gs://artifacts.opnfv.org/"$project""$patchset"/"$img"
         cat gsoutput.txt
         rm -f gsoutput.txt
 
 done
+
+if [[ $GERRIT_EVENT_TYPE = "change-merged" ]] ; then
+    patchset="/$GERRIT_CHANGE_NUMBER"
+    if [ ! -z "$patchset" ]; then
+      gsutil rm gs://artifacts.opnfv.org/"$project""$patchset"/** || true
+    fi
+fi
+
+echo -e "$links"
+
diff --git a/jjb/octopus/docu-verify.sh b/jjb/octopus/docu-verify.sh
deleted file mode 100644 (file)
index f337a7f..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/bash
-set -e
-set -o pipefail
-
-project="$(git remote -v | head -n1 | awk '{{print $2}}' | sed -e 's,.*:\(.*/\)\?,,' -e 's/\.git$//')"
-export PATH=$PATH:/usr/local/bin/
-
-git_sha1="$(git rev-parse HEAD)"
-docu_build_date="$(date)"
-
-files=()
-while read -r -d ''; do
-       files+=("$REPLY")
-done < <(find * -type f -iname '*.rst' -print0)
-
-for file in "${{files[@]}}"; do
-
-       file_cut="${{file%.*}}"
-       gs_cp_folder="${{file_cut}}"
-
-       # sed part
-       sed -i "s/_sha1_/$git_sha1/g" $file
-       sed -i "s/_date_/$docu_build_date/g" $file
-
-       # rst2html part
-       echo "rst2html $file"
-       rst2html $file > $file_cut".html"
-
-       echo "rst2pdf $file"
-       rst2pdf $file -o $file_cut".pdf"
-
-done
-
index b89912c..fe1713c 100644 (file)
 
     builders:
         - shell:
-            !include-raw docu-verify.sh
+            !include-raw docu-build.sh
 
 - job-template:
     name: 'octopus-merge'
index ade400d..057cc97 100644 (file)
@@ -8,11 +8,10 @@ export PATH=$PATH:/usr/local/bin/
 git_sha1="$(git rev-parse HEAD)"
 docu_build_date="$(date)"
 
-if [[ $GERRIT_EVENT_TYPE != "change-merged" ]] ; then
-    patchset="/$GERRIT_CHANGE_NUMBER"
+if [[ $JOB_NAME =~ "verify" ]] ; then
+      patchset="/$GERRIT_CHANGE_NUMBER"
 fi
 
-
 files=()
 while read -r -d ''; do
        files+=("$REPLY")
@@ -61,10 +60,10 @@ for img in "${{images[@]}}"; do
        # uploading found images
        echo "uploading $img"
         cat "$img" | gsutil cp -L gsoutput.txt - \
-        gs://artifacts.opnfv.org/"$project"/"$img"
+        gs://artifacts.opnfv.org/"$project""$patchset"/"$img"
         gsutil setmeta -h "Content-Type:image/jpeg" \
                         -h "Cache-Control:private, max-age=0, no-transform" \
-                        gs://artifacts.opnfv.org/"$project"/"$img"
+                        gs://artifacts.opnfv.org/"$project""$patchset"/"$img"
         cat gsoutput.txt
         rm -f gsoutput.txt
 
@@ -73,7 +72,7 @@ done
 if [[ $GERRIT_EVENT_TYPE = "change-merged" ]] ; then
     patchset="/$GERRIT_CHANGE_NUMBER"
     if [ ! -z "$patchset" ]; then
-      gsutil rm gs://artifacts.opnfv.org/"$project""$patchset"/**
+      gsutil rm gs://artifacts.opnfv.org/"$project""$patchset"/** || true
     fi
 fi
 
diff --git a/jjb/opnfvdocs/docu-verify.sh b/jjb/opnfvdocs/docu-verify.sh
deleted file mode 100644 (file)
index f337a7f..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/bash
-set -e
-set -o pipefail
-
-project="$(git remote -v | head -n1 | awk '{{print $2}}' | sed -e 's,.*:\(.*/\)\?,,' -e 's/\.git$//')"
-export PATH=$PATH:/usr/local/bin/
-
-git_sha1="$(git rev-parse HEAD)"
-docu_build_date="$(date)"
-
-files=()
-while read -r -d ''; do
-       files+=("$REPLY")
-done < <(find * -type f -iname '*.rst' -print0)
-
-for file in "${{files[@]}}"; do
-
-       file_cut="${{file%.*}}"
-       gs_cp_folder="${{file_cut}}"
-
-       # sed part
-       sed -i "s/_sha1_/$git_sha1/g" $file
-       sed -i "s/_date_/$docu_build_date/g" $file
-
-       # rst2html part
-       echo "rst2html $file"
-       rst2html $file > $file_cut".html"
-
-       echo "rst2pdf $file"
-       rst2pdf $file -o $file_cut".pdf"
-
-done
-
index 583654c..057cc97 100644 (file)
@@ -1,12 +1,17 @@
 #!/bin/bash
 set -e
 set -o pipefail
+
 project="$(git remote -v | head -n1 | awk '{{print $2}}' | sed -e 's,.*:\(.*/\)\?,,' -e 's/\.git$//')"
 export PATH=$PATH:/usr/local/bin/
 
 git_sha1="$(git rev-parse HEAD)"
 docu_build_date="$(date)"
 
+if [[ $JOB_NAME =~ "verify" ]] ; then
+      patchset="/$GERRIT_CHANGE_NUMBER"
+fi
+
 files=()
 while read -r -d ''; do
        files+=("$REPLY")
@@ -24,22 +29,25 @@ for file in "${{files[@]}}"; do
        # rst2html part
        echo "rst2html $file"
        rst2html $file | gsutil cp -L gsoutput.txt - \
-       gs://artifacts.opnfv.org/"$project"/"$gs_cp_folder".html
+       gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".html
        gsutil setmeta -h "Content-Type:text/html" \
                        -h "Cache-Control:private, max-age=0, no-transform" \
-                       gs://artifacts.opnfv.org/"$project"/"$gs_cp_folder".html
+                       gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".html
        cat gsoutput.txt
        rm -f gsoutput.txt
 
        echo "rst2pdf $file"
        rst2pdf $file -o - | gsutil cp -L gsoutput.txt - \
-       gs://artifacts.opnfv.org/"$project"/"$gs_cp_folder".pdf
+       gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".pdf
        gsutil setmeta -h "Content-Type:application/pdf" \
                        -h "Cache-Control:private, max-age=0, no-transform" \
-                       gs://artifacts.opnfv.org/"$project"/"$gs_cp_folder".pdf
+                       gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".pdf
        cat gsoutput.txt
        rm -f gsoutput.txt
 
+  links+="http://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".html \n"
+  links+="http://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".pdf \n"
+
 done
 
 images=()
@@ -49,14 +57,24 @@ done < <(find * -type f \( -iname \*.jpg -o -iname \*.png \) -print0)
 
 for img in "${{images[@]}}"; do
 
-        # uploading found images
-        echo "uploading $img"
+       # uploading found images
+       echo "uploading $img"
         cat "$img" | gsutil cp -L gsoutput.txt - \
-        gs://artifacts.opnfv.org/"$project"/"$img"
+        gs://artifacts.opnfv.org/"$project""$patchset"/"$img"
         gsutil setmeta -h "Content-Type:image/jpeg" \
                         -h "Cache-Control:private, max-age=0, no-transform" \
-                        gs://artifacts.opnfv.org/"$project"/"$img"
+                        gs://artifacts.opnfv.org/"$project""$patchset"/"$img"
         cat gsoutput.txt
         rm -f gsoutput.txt
 
 done
+
+if [[ $GERRIT_EVENT_TYPE = "change-merged" ]] ; then
+    patchset="/$GERRIT_CHANGE_NUMBER"
+    if [ ! -z "$patchset" ]; then
+      gsutil rm gs://artifacts.opnfv.org/"$project""$patchset"/** || true
+    fi
+fi
+
+echo -e "$links"
+
diff --git a/jjb/parser/docu-verify.sh b/jjb/parser/docu-verify.sh
deleted file mode 100644 (file)
index 3221dc2..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-set -e
-set -o pipefail
-project="$(git remote -v | head -n1 | awk '{{print $2}}' | sed -e 's,.*:\(.*/\)\?,,' -e 's/\.git$//')"
-export PATH=$PATH:/usr/local/bin/
-
-git_sha1="$(git rev-parse HEAD)"
-docu_build_date="$(date)"
-
-files=()
-while read -r -d ''; do
-       files+=("$REPLY")
-done < <(find * -type f -iname '*.rst' -print0)
-
-for file in "${{files[@]}}"; do
-
-       file_cut="${{file%.*}}"
-       gs_cp_folder="${{file_cut}}"
-
-       # sed part
-       sed -i "s/_sha1_/$git_sha1/g" $file
-       sed -i "s/_date_/$docu_build_date/g" $file
-
-       # rst2html part
-       echo "rst2html $file"
-       rst2html $file > $file_cut".html"
-
-       echo "rst2pdf $file"
-       rst2pdf $file -o $file_cut".pdf"
-
-done
-
index 2c8a2fa..4e9b251 100644 (file)
 
     builders:
         - shell:
-            !include-raw docu-verify.sh
+            !include-raw docu-build.sh
 
 - job-template:
     name: 'parser-merge'
index 499bdbe..057cc97 100644 (file)
@@ -8,6 +8,10 @@ export PATH=$PATH:/usr/local/bin/
 git_sha1="$(git rev-parse HEAD)"
 docu_build_date="$(date)"
 
+if [[ $JOB_NAME =~ "verify" ]] ; then
+      patchset="/$GERRIT_CHANGE_NUMBER"
+fi
+
 files=()
 while read -r -d ''; do
        files+=("$REPLY")
@@ -25,22 +29,25 @@ for file in "${{files[@]}}"; do
        # rst2html part
        echo "rst2html $file"
        rst2html $file | gsutil cp -L gsoutput.txt - \
-       gs://artifacts.opnfv.org/"$project"/"$gs_cp_folder".html
+       gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".html
        gsutil setmeta -h "Content-Type:text/html" \
                        -h "Cache-Control:private, max-age=0, no-transform" \
-                       gs://artifacts.opnfv.org/"$project"/"$gs_cp_folder".html
+                       gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".html
        cat gsoutput.txt
        rm -f gsoutput.txt
 
        echo "rst2pdf $file"
        rst2pdf $file -o - | gsutil cp -L gsoutput.txt - \
-       gs://artifacts.opnfv.org/"$project"/"$gs_cp_folder".pdf
+       gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".pdf
        gsutil setmeta -h "Content-Type:application/pdf" \
                        -h "Cache-Control:private, max-age=0, no-transform" \
-                       gs://artifacts.opnfv.org/"$project"/"$gs_cp_folder".pdf
+                       gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".pdf
        cat gsoutput.txt
        rm -f gsoutput.txt
 
+  links+="http://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".html \n"
+  links+="http://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".pdf \n"
+
 done
 
 images=()
@@ -53,11 +60,21 @@ for img in "${{images[@]}}"; do
        # uploading found images
        echo "uploading $img"
         cat "$img" | gsutil cp -L gsoutput.txt - \
-        gs://artifacts.opnfv.org/"$project"/"$img"
+        gs://artifacts.opnfv.org/"$project""$patchset"/"$img"
         gsutil setmeta -h "Content-Type:image/jpeg" \
                         -h "Cache-Control:private, max-age=0, no-transform" \
-                        gs://artifacts.opnfv.org/"$project"/"$img"
+                        gs://artifacts.opnfv.org/"$project""$patchset"/"$img"
         cat gsoutput.txt
         rm -f gsoutput.txt
 
 done
+
+if [[ $GERRIT_EVENT_TYPE = "change-merged" ]] ; then
+    patchset="/$GERRIT_CHANGE_NUMBER"
+    if [ ! -z "$patchset" ]; then
+      gsutil rm gs://artifacts.opnfv.org/"$project""$patchset"/** || true
+    fi
+fi
+
+echo -e "$links"
+
diff --git a/jjb/pharos/docu-verify.sh b/jjb/pharos/docu-verify.sh
deleted file mode 100644 (file)
index f337a7f..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/bash
-set -e
-set -o pipefail
-
-project="$(git remote -v | head -n1 | awk '{{print $2}}' | sed -e 's,.*:\(.*/\)\?,,' -e 's/\.git$//')"
-export PATH=$PATH:/usr/local/bin/
-
-git_sha1="$(git rev-parse HEAD)"
-docu_build_date="$(date)"
-
-files=()
-while read -r -d ''; do
-       files+=("$REPLY")
-done < <(find * -type f -iname '*.rst' -print0)
-
-for file in "${{files[@]}}"; do
-
-       file_cut="${{file%.*}}"
-       gs_cp_folder="${{file_cut}}"
-
-       # sed part
-       sed -i "s/_sha1_/$git_sha1/g" $file
-       sed -i "s/_date_/$docu_build_date/g" $file
-
-       # rst2html part
-       echo "rst2html $file"
-       rst2html $file > $file_cut".html"
-
-       echo "rst2pdf $file"
-       rst2pdf $file -o $file_cut".pdf"
-
-done
-
index 391180b..6fcd11b 100644 (file)
 
     builders:
         - shell:
-            !include-raw docu-verify.sh
+            !include-raw docu-build.sh
 
 - job-template:
     name: 'pharos-merge'
index 583654c..057cc97 100644 (file)
@@ -1,12 +1,17 @@
 #!/bin/bash
 set -e
 set -o pipefail
+
 project="$(git remote -v | head -n1 | awk '{{print $2}}' | sed -e 's,.*:\(.*/\)\?,,' -e 's/\.git$//')"
 export PATH=$PATH:/usr/local/bin/
 
 git_sha1="$(git rev-parse HEAD)"
 docu_build_date="$(date)"
 
+if [[ $JOB_NAME =~ "verify" ]] ; then
+      patchset="/$GERRIT_CHANGE_NUMBER"
+fi
+
 files=()
 while read -r -d ''; do
        files+=("$REPLY")
@@ -24,22 +29,25 @@ for file in "${{files[@]}}"; do
        # rst2html part
        echo "rst2html $file"
        rst2html $file | gsutil cp -L gsoutput.txt - \
-       gs://artifacts.opnfv.org/"$project"/"$gs_cp_folder".html
+       gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".html
        gsutil setmeta -h "Content-Type:text/html" \
                        -h "Cache-Control:private, max-age=0, no-transform" \
-                       gs://artifacts.opnfv.org/"$project"/"$gs_cp_folder".html
+                       gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".html
        cat gsoutput.txt
        rm -f gsoutput.txt
 
        echo "rst2pdf $file"
        rst2pdf $file -o - | gsutil cp -L gsoutput.txt - \
-       gs://artifacts.opnfv.org/"$project"/"$gs_cp_folder".pdf
+       gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".pdf
        gsutil setmeta -h "Content-Type:application/pdf" \
                        -h "Cache-Control:private, max-age=0, no-transform" \
-                       gs://artifacts.opnfv.org/"$project"/"$gs_cp_folder".pdf
+                       gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".pdf
        cat gsoutput.txt
        rm -f gsoutput.txt
 
+  links+="http://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".html \n"
+  links+="http://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".pdf \n"
+
 done
 
 images=()
@@ -49,14 +57,24 @@ done < <(find * -type f \( -iname \*.jpg -o -iname \*.png \) -print0)
 
 for img in "${{images[@]}}"; do
 
-        # uploading found images
-        echo "uploading $img"
+       # uploading found images
+       echo "uploading $img"
         cat "$img" | gsutil cp -L gsoutput.txt - \
-        gs://artifacts.opnfv.org/"$project"/"$img"
+        gs://artifacts.opnfv.org/"$project""$patchset"/"$img"
         gsutil setmeta -h "Content-Type:image/jpeg" \
                         -h "Cache-Control:private, max-age=0, no-transform" \
-                        gs://artifacts.opnfv.org/"$project"/"$img"
+                        gs://artifacts.opnfv.org/"$project""$patchset"/"$img"
         cat gsoutput.txt
         rm -f gsoutput.txt
 
 done
+
+if [[ $GERRIT_EVENT_TYPE = "change-merged" ]] ; then
+    patchset="/$GERRIT_CHANGE_NUMBER"
+    if [ ! -z "$patchset" ]; then
+      gsutil rm gs://artifacts.opnfv.org/"$project""$patchset"/** || true
+    fi
+fi
+
+echo -e "$links"
+
diff --git a/jjb/prediction/docu-verify.sh b/jjb/prediction/docu-verify.sh
deleted file mode 100644 (file)
index 3221dc2..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-set -e
-set -o pipefail
-project="$(git remote -v | head -n1 | awk '{{print $2}}' | sed -e 's,.*:\(.*/\)\?,,' -e 's/\.git$//')"
-export PATH=$PATH:/usr/local/bin/
-
-git_sha1="$(git rev-parse HEAD)"
-docu_build_date="$(date)"
-
-files=()
-while read -r -d ''; do
-       files+=("$REPLY")
-done < <(find * -type f -iname '*.rst' -print0)
-
-for file in "${{files[@]}}"; do
-
-       file_cut="${{file%.*}}"
-       gs_cp_folder="${{file_cut}}"
-
-       # sed part
-       sed -i "s/_sha1_/$git_sha1/g" $file
-       sed -i "s/_date_/$docu_build_date/g" $file
-
-       # rst2html part
-       echo "rst2html $file"
-       rst2html $file > $file_cut".html"
-
-       echo "rst2pdf $file"
-       rst2pdf $file -o $file_cut".pdf"
-
-done
-
index bf4c56b..7f7dd3b 100644 (file)
 
     builders:
         - shell:
-            !include-raw docu-verify.sh
+            !include-raw docu-build.sh
 
 - job-template:
     name: 'prediction-merge'
index 583654c..057cc97 100644 (file)
@@ -1,12 +1,17 @@
 #!/bin/bash
 set -e
 set -o pipefail
+
 project="$(git remote -v | head -n1 | awk '{{print $2}}' | sed -e 's,.*:\(.*/\)\?,,' -e 's/\.git$//')"
 export PATH=$PATH:/usr/local/bin/
 
 git_sha1="$(git rev-parse HEAD)"
 docu_build_date="$(date)"
 
+if [[ $JOB_NAME =~ "verify" ]] ; then
+      patchset="/$GERRIT_CHANGE_NUMBER"
+fi
+
 files=()
 while read -r -d ''; do
        files+=("$REPLY")
@@ -24,22 +29,25 @@ for file in "${{files[@]}}"; do
        # rst2html part
        echo "rst2html $file"
        rst2html $file | gsutil cp -L gsoutput.txt - \
-       gs://artifacts.opnfv.org/"$project"/"$gs_cp_folder".html
+       gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".html
        gsutil setmeta -h "Content-Type:text/html" \
                        -h "Cache-Control:private, max-age=0, no-transform" \
-                       gs://artifacts.opnfv.org/"$project"/"$gs_cp_folder".html
+                       gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".html
        cat gsoutput.txt
        rm -f gsoutput.txt
 
        echo "rst2pdf $file"
        rst2pdf $file -o - | gsutil cp -L gsoutput.txt - \
-       gs://artifacts.opnfv.org/"$project"/"$gs_cp_folder".pdf
+       gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".pdf
        gsutil setmeta -h "Content-Type:application/pdf" \
                        -h "Cache-Control:private, max-age=0, no-transform" \
-                       gs://artifacts.opnfv.org/"$project"/"$gs_cp_folder".pdf
+                       gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".pdf
        cat gsoutput.txt
        rm -f gsoutput.txt
 
+  links+="http://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".html \n"
+  links+="http://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".pdf \n"
+
 done
 
 images=()
@@ -49,14 +57,24 @@ done < <(find * -type f \( -iname \*.jpg -o -iname \*.png \) -print0)
 
 for img in "${{images[@]}}"; do
 
-        # uploading found images
-        echo "uploading $img"
+       # uploading found images
+       echo "uploading $img"
         cat "$img" | gsutil cp -L gsoutput.txt - \
-        gs://artifacts.opnfv.org/"$project"/"$img"
+        gs://artifacts.opnfv.org/"$project""$patchset"/"$img"
         gsutil setmeta -h "Content-Type:image/jpeg" \
                         -h "Cache-Control:private, max-age=0, no-transform" \
-                        gs://artifacts.opnfv.org/"$project"/"$img"
+                        gs://artifacts.opnfv.org/"$project""$patchset"/"$img"
         cat gsoutput.txt
         rm -f gsoutput.txt
 
 done
+
+if [[ $GERRIT_EVENT_TYPE = "change-merged" ]] ; then
+    patchset="/$GERRIT_CHANGE_NUMBER"
+    if [ ! -z "$patchset" ]; then
+      gsutil rm gs://artifacts.opnfv.org/"$project""$patchset"/** || true
+    fi
+fi
+
+echo -e "$links"
+
diff --git a/jjb/promise/docu-verify.sh b/jjb/promise/docu-verify.sh
deleted file mode 100644 (file)
index 3221dc2..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-set -e
-set -o pipefail
-project="$(git remote -v | head -n1 | awk '{{print $2}}' | sed -e 's,.*:\(.*/\)\?,,' -e 's/\.git$//')"
-export PATH=$PATH:/usr/local/bin/
-
-git_sha1="$(git rev-parse HEAD)"
-docu_build_date="$(date)"
-
-files=()
-while read -r -d ''; do
-       files+=("$REPLY")
-done < <(find * -type f -iname '*.rst' -print0)
-
-for file in "${{files[@]}}"; do
-
-       file_cut="${{file%.*}}"
-       gs_cp_folder="${{file_cut}}"
-
-       # sed part
-       sed -i "s/_sha1_/$git_sha1/g" $file
-       sed -i "s/_date_/$docu_build_date/g" $file
-
-       # rst2html part
-       echo "rst2html $file"
-       rst2html $file > $file_cut".html"
-
-       echo "rst2pdf $file"
-       rst2pdf $file -o $file_cut".pdf"
-
-done
-
index 3196ef4..52db797 100644 (file)
 
     builders:
         - shell:
-            !include-raw docu-verify.sh
+            !include-raw docu-build.sh
 
 - job-template:
     name: 'promise-merge'