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 $GERRIT_EVENT_TYPE="patchset-created"; then
12 patchset="/$GERRIT_CHANGE_NUMBER"
17 while read -r -d ''; do
19 done < <(find * -type f -iname '*.rst' -print0)
21 for file in "${{files[@]}}"; do
23 file_cut="${{file%.*}}"
24 gs_cp_folder="${{file_cut}}"
27 sed -i "s/_sha1_/$git_sha1/g" $file
28 sed -i "s/_date_/$docu_build_date/g" $file
32 rst2html $file | gsutil cp -L gsoutput.txt - \
33 gs://artifacts.opnfv.org/"$project"/"$gs_cp_folder".html
34 gsutil setmeta -h "Content-Type:text/html" \
35 -h "Cache-Control:private, max-age=0, no-transform" \
36 gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".html
41 rst2pdf $file -o - | gsutil cp -L gsoutput.txt - \
42 gs://artifacts.opnfv.org/"$project"/"$gs_cp_folder".pdf
43 gsutil setmeta -h "Content-Type:application/pdf" \
44 -h "Cache-Control:private, max-age=0, no-transform" \
45 gs://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".pdf
49 links+="http://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".html \n"
50 links+="http://artifacts.opnfv.org/"$project""$patchset"/"$gs_cp_folder".pdf \n"
55 while read -r -d ''; do
57 done < <(find * -type f \( -iname \*.jpg -o -iname \*.png \) -print0)
59 for img in "${{images[@]}}"; do
61 # uploading found images
63 cat "$img" | gsutil cp -L gsoutput.txt - \
64 gs://artifacts.opnfv.org/"$project"/"$img"
65 gsutil setmeta -h "Content-Type:image/jpeg" \
66 -h "Cache-Control:private, max-age=0, no-transform" \
67 gs://artifacts.opnfv.org/"$project"/"$img"