-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-webhare.sh
67 lines (50 loc) · 2.46 KB
/
install-webhare.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
#!/bin/bash
installpath="$HOME/projects"
##FIXME whalias="eval `~/projects/webhare/whtree/bin/wh setupmyshell`"
printf "\n## This script will install WebHare to $installpath ##\n\n"
printf "## - creating directory $installpath ##\n"
mkdir -p "$installpath"
cd "$installpath"
printf "\n## - cloning WebHare from Gitlab ##\n"
git clone [email protected]:webhare/webhare.git webhare
printf "\n## - checkout the correct Git branch ##\n"
cd webhare
git fetch
git checkout -b wh-setupbuild origin/wh-setupbuild
printf "\n## - setting up the 'wh' alias ##\n"
#FIXME! How to add the $whalias line as a line?
#cat "$HOME/.bash_profile" | pbcopy && echo "$whalias" > "$HOME/.bash_profile" && pbpaste >> "$HOME/.bash_profile"
#printf "eval `$HOME/projects/webhare/whtree/bin/wh setupmyshell`"
if [ -f "$HOME/.bash_profile" ]; then
source "$HOME/.bash_profile"
fi
printf "\n## - running 'wh setupbuild' ##\n"
~/projects/webhare/whtree/bin/wh setupbuild
printf "\n## - update the Makefile ##\n"
cat "$installpath/whbuild/Makefile" | pbcopy && echo "NOTEST=1" > "$installpath/whbuild/Makefile" && pbpaste >> "$installpath/whbuild/Makefile"
#echo "NOTEST=1\nSRCDIR=../webhare\ninclude $(SRCDIR)/base_makefile" > "$installpath/whbuild/Makefile"
cd "$installpath/whbuild/"
make clean
printf "\n## - running the first Make & Install ##\n"
cd "$installpath"
~/projects/webhare/whtree/bin/wh make install
~/projects/webhare/whtree/bin/wh make postuninstall
~/projects/webhare/whtree/bin/wh make postinstall
printf "## - setting up '~/mods/' symbolic link for convenience ##\n"
ln -s "$installpath/webhare/whtree/var/installedmodules" ~/mods
printf "\n## - installing extra base modules ##\n"
~/projects/webhare/whtree/bin/wh getmodule webhare/socialite
~/projects/webhare/whtree/bin/wh getmodule webhare/tollium_dev
~/projects/webhare/whtree/bin/wh getmodule webhare/google
#FIXME: internal base module ---------- wh getmodule [email protected]:itmundi/....git
printf "\n## - running WebHare in the background ##\n"
~/projects/webhare/whtree/bin/webhare daemon
printf "\n## - give WebHare some time to start for the first time (sleeping now...) ##\n"
sleep 20
#FIXME: run 'wh console' (screen -r?)
printf "## - run 'wh setupdev', which will setup a basic development environment ##\n"
~/projects/webhare/whtree/bin/wh setupdev
#FIXME: Doesn't 'wh setupdev' perform a soft reset already?
#printf "## - all done; performing a soft reset just to be sure ##\n"
#~/projects/webhare/whtree/bin/wh softreset
printf '\n'