-
Notifications
You must be signed in to change notification settings - Fork 19
/
build.sh
executable file
·43 lines (37 loc) · 1.09 KB
/
build.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
#!/bin/sh
while [ $# -gt 0 ] ; do
case $1 in
--help) helpEnabled="true" ; shift 1 ;;
clean) cleanEnabled="true" ; shift 1 ;;
build) buildEnabled="true" ; shift 1 ;;
publish) buildEnabled="true" ; publishEnabled="true" ; shift 1 ;;
*) shift 1 ;;
esac
done
if [ "${helpEnabled}" = "true" ]; then
echo "Options:"
echo " --help this help message"
echo " clean - Delete generated files"
echo " build - Build website"
echo " publish - Publish to dashbuilder.org"
echo "In development, just use \"awestruct -d\""
exit 0;
fi
# Change directory to the directory of the script
cd `dirname $0`
siteDir="`pwd -P`/_site/"
if [ "${cleanEnabled}" = "true" ]; then
echo "Cleaning ${siteDir}"
rake clean
fi
if [ "${buildEnabled}" = "true" ]; then
echo "Building ${siteDir}"
rake build
fi
if [ "${publishEnabled}" = "true" ]; then
publishDir="filemgmt.jboss.org:/www_htdocs/dashbuilder/"
echo "Deploying ${siteDir} to ${publishDir}"
echo -n "Username: "
read publishDirUsername
rsync -avz --delete --progress --protocol=29 ${siteDir} ${publishDirUsername}@${publishDir}
fi