forked from leosac/access-control
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_doc.sh
executable file
·44 lines (35 loc) · 1.3 KB
/
build_doc.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
##
## We use the static-pages for hand-crafted HTML content.
## We want to keep history of this static-pages branch.
## The gh-pages contains the full website: hand-crafted HTML + generated
## documentation. We are not interrested in the history of this branch:
## * The repo will get fat. Fast.
## * Since the documentation is generated, we can generated previous
## version of the documentation manually.
set -e
set -x
REPO_DIRECTORY=/home/xaqq/Documents/leosac
cd $REPO_DIRECTORY
## Generate documentation tarball from the current tree.
git checkout develop
doxygen && tar cvf /tmp/leosac_develop_doc.tar -C doc/html .
tar cvf /tmp/leosac_develop_doc_rc.tar -C doc/resources .
cp doc/doxy-boot.js /tmp
## Create a new gh-pages from the static-pages tree.
git checkout static-pages
git branch -D gh-pages || true
git checkout -b gh-pages
BRANCH=develop
## Extract the previous tarball.
mkdir -p doc_output/$BRANCH/html/ doc_output/$BRANCH/resources
tar xvf /tmp/leosac_develop_doc.tar -C doc_output/$BRANCH/html/
tar xvf /tmp/leosac_develop_doc_rc.tar -C doc_output/$BRANCH/resources
for directory in `find doc_output/$BRANCH/ -type d`
do
cp /tmp/doxy-boot.js $directory
done
git add doc_output/$BRANCH
git commit -m "Adding generated documentation"
#git push origin gh-pages -f
echo "Success!"