Skip to content

Commit

Permalink
Added a simple startup script
Browse files Browse the repository at this point in the history
  • Loading branch information
wakaleo committed Oct 6, 2014
1 parent f7daab4 commit 6b2cd0f
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ build
.idea
.gradle
*.log
mongodb.log.*
*.iws
dist
node_modules
Expand Down
49 changes: 49 additions & 0 deletions flying-high.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash
startMongo() {
mongod --fork --logpath mongodb.log
}

stopMongo() {
mongod --shutdown
}

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

0 comments on commit 6b2cd0f

Please sign in to comment.