forked from IPVS-AS/MBP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate.sh
27 lines (20 loc) · 1.04 KB
/
update.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
#!/bin/sh
#########################################################################################################################
# This script automates the process of executing the program after changes in code.
# It only works on Linux
# To run it, make sure you are in the project's main folder and
# $ sh ./update.sh
#########################################################################################################################
# Creates a new MBP.war package in project's taget folder
echo "Building .war file..."
sudo mvn clean install
# Deploys .war file by moving it to tomcat's webapps folder (using wildcards for file name)
echo "Deploying .war file..."
find target/ -name "MBP-*.war" -print0 | xargs -0 -I {} sudo mv {} /var/lib/tomcat8/webapps/MBP.war
# Restarts tomcat8
echo "Restarting tomcat..."
sudo service tomcat8 restart
echo "Update finished. Good luck! ;)"
# You now can find your modified application in localhost:8080/MBP
# I hope it works!
# If if doesn't, you can always change your code and rerun this script. :)