Skip to content

Commit a7b82f7

Browse files
committed
docs: Add build script
There is currently no script to build the docs with, this is an easy script to build them. An example how I use it: $ cd ~wido/repos/cloudstack $ tools/build/build_docs.sh -s $(echo ~wido/repos/cloudstack)
1 parent 4aa2e91 commit a7b82f7

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

tools/build/build_docs.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
3+
sourcedir=~/incubator-cloudstack/
4+
common_content_dir=/usr/share/publican/Common_Content
5+
publican_path=/usr/bin/publican
6+
7+
usage(){
8+
echo "usage: $0 [-s source dir] [-c publican common content] [-p path to publican]"
9+
echo " -s sets the source directory (defaults to $sourcedir)"
10+
echo " -c sets the public common content directory (defaults to $common_content_dir)"
11+
echo " -p sets the path to the publican binary (defaults to $publican_path)"
12+
echo " -h"
13+
}
14+
15+
while getopts v:s:c:p:h opt
16+
do
17+
case "$opt" in
18+
v) version="$OPTARG";;
19+
s) sourcedir="$OPTARG";;
20+
c) common_content_dir="$OPTARG";;
21+
p) publican_path="$OPTARG";;
22+
h) usage
23+
exit 0;;
24+
\?)
25+
usage
26+
exit 1;;
27+
esac
28+
done
29+
30+
if [ ! -x "$publican_path" ]; then
31+
echo "$publican_path doesn't seem like an executeable?"
32+
exit 1
33+
fi
34+
35+
cd $sourcedir/docs
36+
cp -R /usr/share/publican/Common_Content .
37+
ln -s $sourcedir/docs/publican-cloudstack Common_Content/cloudstack
38+
publican build --config=publican-all.cfg --formats html,pdf --langs en-US --common_content=$sourcedir/docs/Common_Content
39+
rm -r Common_Content

0 commit comments

Comments
 (0)