forked from xiaolongzuo/personal-blog-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upgrade_java.sh
31 lines (28 loc) · 1.75 KB
/
upgrade_java.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
#!/bin/bash
cd /home/zuoxiaolong/personal-blog-webapp
git pull
sleep 5
mvn clean install -Dmaven.test.skip=true
rm -f /home/zuoxiaolong/personal-blog-webapp-server/personal-blog-webapp-server.jar
cp personal-blog-webapp-server/target/personal-blog-webapp-server.jar /home/zuoxiaolong/personal-blog-webapp-server/
cd personal-blog-webapp-site/target
rm -rf /home/zuoxiaolong/personal-blog-webapp-site/WEB-INF
rm -rf /home/zuoxiaolong/personal-blog-webapp-site/resources
rm -rf /home/zuoxiaolong/personal-blog-webapp-site/record
rm -rf /home/zuoxiaolong/personal-blog-webapp-site/admin
rm -rf /home/zuoxiaolong/personal-blog-webapp-site/blog
rm -rf /home/zuoxiaolong/personal-blog-webapp-site/common
rm -rf /home/zuoxiaolong/personal-blog-webapp-site/message
rm -rf /home/zuoxiaolong/personal-blog-webapp-site/META-INF
rm -rf /home/zuoxiaolong/personal-blog-webapp-site/question
unzip -qo zuoxiaolong.war -d /home/zuoxiaolong/personal-blog-webapp-site
cp -f /home/zuoxiaolong/product/dirty.words.txt /home/zuoxiaolong/personal-blog-webapp-site/WEB-INF/classes/dirty.words.txt
cp -f /home/zuoxiaolong/product/jdbc.properties /home/zuoxiaolong/personal-blog-webapp-site/WEB-INF/classes/jdbc.properties
cp -f /home/zuoxiaolong/product/log4j.properties /home/zuoxiaolong/personal-blog-webapp-site/WEB-INF/classes/log4j.properties
cp -f /home/zuoxiaolong/product/setting.properties /home/zuoxiaolong/personal-blog-webapp-site/WEB-INF/classes/setting.properties
ps -ef | grep 'personal-blog-webapp-server' | grep -v 'grep' | awk '{print "kill -9 " $2}' | sh
sleep 2
echo "personal-blog-webapp-server killed ,wait restart..."
ps -ef | grep 'org.apache.catalina.startup.Bootstrap' | grep -v 'grep' | awk '{print "kill -9 " $2}' | sh
sleep 2
echo "personal-blog-webapp-site killed ,wait restart..."