-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy
36 lines (27 loc) · 751 Bytes
/
deploy
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
#!/bin/bash
cd ~/CycleSafeServer
TOMCAT_INIT=/etc/init.d/tomcat7;
OLD_DEPLOYMENT=/var/lib/tomcat7/webapps/ROOT
#get changes from git
echo "Updating from remote repository..."
git reset --hard origin/master;
git pull;
chmod +x deploy
#shutdown tomcat while we redeploy
echo "Stopping tomcat..."
sudo $TOMCAT_INIT stop;
#remove previous build
echo "Removing previous build..."
sudo rm -r "$OLD_DEPLOYMENT";
sudo rm "$OLD_DEPLOYMENT.war";
#build with dependencies
echo "Making new build..."
sudo mvn package;
#start tomcat again
echo "Restarting tomcat..."
sudo $TOMCAT_INIT start;
#Removing these should speed up the build
#if it breaks stuff put them back in
#remove target dir
#echo "Cleaning up compile time dependencies.."
#sudo mvn clean;