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 subdir="/$GERRIT_CHANGE_NUMBER"
18 while read -r -d ''; do
20 done < <(find * -type f -iname '*.rst' -print0)
22 for file in "${{files[@]}}"; do
24 file_cut="${{file%.*}}"
25 gs_cp_folder="${{file_cut}}"
28 sed -i "s/_sha1_/$git_sha1/g" $file
29 sed -i "s/_date_/$docu_build_date/g" $file
33 rst2html $file | gsutil cp -L gsoutput.txt - \
34 gs://artifacts.opnfv.org/"$project""$subdir"/"$gs_cp_folder".html
35 gsutil setmeta -h "Content-Type:text/html" \
36 -h "Cache-Control:private, max-age=0, no-transform" \
37 gs://artifacts.opnfv.org/"$project""$subdir"/"$gs_cp_folder".html
42 rst2pdf $file -o - | gsutil cp -L gsoutput.txt - \
43 gs://artifacts.opnfv.org/"$project""$subdir"/"$gs_cp_folder".pdf
44 gsutil setmeta -h "Content-Type:application/pdf" \
45 -h "Cache-Control:private, max-age=0, no-transform" \
46 gs://artifacts.opnfv.org/"$project""$subdir"/"$gs_cp_folder".pdf
50 links+="http://artifacts.opnfv.org/"$project""$subdir"/"$gs_cp_folder".html \n"
51 links+="http://artifacts.opnfv.org/"$project""$subdir"/"$gs_cp_folder".pdf \n"
56 while read -r -d ''; do
58 done < <(find * -type f \( -iname \*.jpg -o -iname \*.png \) -print0)
60 for img in "${{images[@]}}"; do
62 # uploading found images
64 cat "$img" | gsutil cp -L gsoutput.txt - \
65 gs://artifacts.opnfv.org/"$project""$subdir"/"$img"
66 gsutil setmeta -h "Content-Type:image/jpeg" \
67 -h "Cache-Control:private, max-age=0, no-transform" \
68 gs://artifacts.opnfv.org/"$project""$subdir"/"$img"
74 if [[ $GERRIT_EVENT_TYPE = "change-merged" ]] ; then
75 subdir="/$GERRIT_CHANGE_NUMBER"
76 if [ ! -z "$subdir" ]; then
77 gsutil rm gs://artifacts.opnfv.org/"$project""$subdir"/** || true