-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy_webapp.sh
46 lines (36 loc) · 911 Bytes
/
deploy_webapp.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
TOMCAT_HOME=/usr/tomcat7
echo "Tomcat Home:$TOMCAT_HOME"
echo "Input:$1"
if [ "$1" != "" ]; then
WAR_PATH=$1
echo "Update path"
else
WAR_PATH=./shopizer/sm-shop/target/sm-shop-2.0.1-SNAPSHOT.war
fi
echo "war package path: $WAR_PATH"
#echo "Sync source code..."
#git pull
echo "Update Evn.."
source /etc/profile
echo "Shutdow tomcat..."
$TOMCAT_HOME/bin/shutdown.sh
if [ "$1" == "build" ]; then
echo "cd to sub dir.."
cd ./shopizer
echo "Start to build project.."
mvn clean
echo ""
echo ""
mvn package
cd ../
WAR_PATH=./shopizer/sm-shop/target/sm-shop-2.0.1-SNAPSHOT.war
fi
echo "Backup old project..."
rm /home/frankie/backup/ebc -rf
mv $TOMCAT_HOME/webapps/ebc /home/frankie/backup/
echo "Start to deploy..."
unzip -oq $WAR_PATH -d $TOMCAT_HOME/webapps/ebc
sleep 1
echo "Start tomcat..."
$TOMCAT_HOME/bin/startup.sh
echo "Finished."