forked from keycloak/keycloak-documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-product.sh
executable file
·70 lines (57 loc) · 1.71 KB
/
build-product.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
TOOL="asciidoctor"
while getopts "h?auc" opt; do
case "$opt" in
h|\?)
echo "Usage: build-guide.sh [OPTION] [GUIDE]"
echo ""
echo " -a use asciidoctor (default)"
echo " -u use ccutil"
echo " -c delete built guides"
echo ""
echo "If guide is not specified all guides are built. GUIDE should be the directory"
echo "name of the specific guide to build."
exit 0
;;
a) TOOL="asciidoctor"
;;
u) TOOL="ccutil"
;;
c) TOOL="clean"
;;
esac
done
shift $((OPTIND-1))
[ "$1" = "--" ] && shift
GUIDE=$1
function buildGuide
{
GUIDE=$1
CURRENT_DIRECTORY=$(pwd)
echo "***********************************************************************************************************"
echo "$TOOL: $GUIDE"
echo ""
cd $GUIDE
rm -rf build
rm -rf target
python ../gitlab-conversion.py
if [ "$TOOL" = "asciidoctor" ]; then
asciidoctor -dbook -a toc -o target/master.html target/master.adoc
echo ""
echo "Built file://$CURRENT_DIRECTORY/$GUIDE/target/master.html"
fi
if [ "$TOOL" = "ccutil" ]; then
ccutil compile --lang en_US --format html-single --main-file target/master.adoc
echo ""
echo "Built file://$CURRENT_DIRECTORY/$GUIDE/build/tmp/en-US/html-single/index.html"
fi
cd ..
}
if [ "$GUIDE" = "" ]; then
for i in authorization_services getting_started securing_apps server_admin server_development server_installation; do
buildGuide $i
done
else
buildGuide $GUIDE
fi
echo "***********************************************************************************************************"