01338efe4cae03eb31594235605391d33c0bb470
[releng.git] / jjb / octopus / build-docu-verify.sh
1 #!/bin/bash
2 project="octopus"
3 export PATH=$PATH:/usr/local/bin/
4
5 git_sha1="$(git rev-parse HEAD)"
6 docu_build_date="$(date)"
7
8 files=()
9 while read -r -d ''; do
10         files+=("$REPLY")
11 done < <(find * -type f -iname '*.rst' -print0)
12
13 for file in "${{files[@]}}"; do
14
15         file_cut="${{file%.*}}"
16         gs_cp_folder="${{file_cut}}"
17
18         # sed part
19         sed -i "s/_sha1_/$git_sha1/g" $file
20         sed -i "s/_date_/$docu_build_date/g" $file
21
22         # rst2html part
23         echo "rst2html $file"
24         rst2html $file > $file_cut".html"
25
26         echo "rst2pdf $file"
27         rst2pdf $file -o $file_cut".pdf"
28
29 done
30