5 project="$(git remote -v | head -n1 | awk '{{print $2}}' | sed -e 's,.*:\(.*/\)\?,,' -e 's/\.git$//')"
6 export PATH=$PATH:/usr/local/bin/
8 git_sha1="$(git rev-parse HEAD)"
9 docu_build_date="$(date)"
11 if [[ $JOB_NAME =~ "verify" ]] ; then
12 patchset="/$GERRIT_CHANGE_NUMBER"
16 while read -r -d ''; do
18 done < <(find * -type f -iname '*.rst' -print0)
20 for file in "${{files[@]}}"; do
22 file_cut="${{file%.*}}"
23 gs_cp_folder="${{file_cut}}"
26 sed -i "s/_sha1_/$git_sha1/g" $file
27 sed -i "s/_date_/$docu_build_date/g" $file
31 rst2html $file | gsutil cp -L gsoutput.txt - \
32 gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".html
33 gsutil setmeta -h "Content-Type:text/html" \
34 -h "Cache-Control:private, max-age=0, no-transform" \
35 gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".html
40 rst2pdf $file -o - | gsutil cp -L gsoutput.txt - \
41 gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".pdf
42 gsutil setmeta -h "Content-Type:application/pdf" \
43 -h "Cache-Control:private, max-age=0, no-transform" \
44 gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".pdf
48 links+="http://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".html \n"
49 links+="http://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".pdf \n"
54 while read -r -d ''; do
56 done < <(find * -type f \( -iname \*.jpg -o -iname \*.png \) -print0)
58 for img in "${{images[@]}}"; do
60 # uploading found images
62 cat "$img" | gsutil cp -L gsoutput.txt - \
63 gs://artifacts.opnfv.org/"$project""$patchset"/"$img"
64 gsutil setmeta -h "Content-Type:image/jpeg" \
65 -h "Cache-Control:private, max-age=0, no-transform" \
66 gs://artifacts.opnfv.org/"$project""$patchset"/"$img"
72 if [[ $GERRIT_EVENT_TYPE = "change-merged" ]] ; then
73 patchset="/$GERRIT_CHANGE_NUMBER"
74 if [ ! -z "$patchset" ]; then
75 gsutil rm gs://artifacts.opnfv.org/"$project""$patchset"/** || true