-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·52 lines (44 loc) · 1 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
44
45
46
47
48
49
50
51
52
function web {
echo "Building Web"
cd WebTinyTank
sudo meteor update
sudo meteor build .
sudo mv WebTinyTank.tar.gz /opt/tinytank/web/.
cd /opt/tinytank/web/
sudo service tinytankweb stop
sudo rm -rf bundle/
sudo tar -zxf WebTinyTank.tar.gz
cd bundle/programs/server/
sudo npm install
cd /opt/tinytank
sudo chown tinytank -R /opt/tinytank
sudo service tinytankweb start
}
function data {
echo "Building Data"
sudo tar -zcf DataTinyTank.tar.gz DataTinyTank
sudo mv DataTinyTank.tar.gz /opt/tinytank/.
cd /opt/tinytank
sudo service tinytankdata stop
sudo rm -rf data
sudo tar -zxf DataTinyTank.tar.gz
sudo mv DataTinyTank data
cd data
sudo npm install
cd /opt/tinytank
sudo chown tinytank -R /opt/tinytank
sudo service tinytankdata start
}
git pull
current=`pwd`
if [ $# -eq 0 ]; then
web
cd $current
data
else
$1
fi
cd $current
sudo service nginx restart
sudo rm -f /opt/tinytank/DataTinyTank.tar.gz /opt/tinytank/web/WebTinyTank.tar.gz
echo "There you go :)"