-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathflying-high.sh
executable file
·49 lines (41 loc) · 946 Bytes
/
flying-high.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
#!/bin/bash
startMongo() {
mongod --fork --logpath mongodb.log
}
stopMongo() {
pkill mongod
}
startAccountsService() {
java -jar accounts-web-service/build/libs/accounts-web-service-1.0.0.jar & >/dev/null 2>&1
}
stopAccountsService() {
export pid=`ps | grep accounts-web-service | awk 'NR==1{print $1}' | cut -d' ' -f1`;kill $pid
}
startFlightsService() {
java -jar flights-web-service/build/libs/flights-web-service-1.0.0.jar & >/dev/null 2>&1
}
stopFlightsService() {
export pid=`ps | grep flights-web-service | awk 'NR==1{print $1}' | cut -d' ' -f1`;kill $pid
}
startApp() {
cd flying-high-app
npm install
bower install
grunt serve & >/dev/null 2>&1
}
if [ "$1" = "start" ] ;
then
echo "Starting Flying High services"
startMongo
startAccountsService
startFlightsService
startApp
fi
if [ "$1" = "stop" ] ;
then
echo "Shutting down Flying High services"
stopMongo
stopAccountsService
stopFlightsService
stopApp
fi