Last active
January 13, 2019 05:31
-
-
Save diaolizhi/aa4d0702ce076bf7628bd19570967343 to your computer and use it in GitHub Desktop.
Linux git 同步 maven 编译 java -jar 执行
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 项目名 | |
PRONAME="demo" | |
#echo $PRONAME | |
# 项目所在路径 | |
PROPATH='/root/tieba-demo/Tieba/' | |
nohup git pull origin master >/dev/null 2>&1 | |
#git pull origin master | |
cd $PROPATH | |
nohup mvn install -DskipTests >/dev/null 2>&1 | |
#mvn install -DskipTests | |
cd target | |
FILENAME=`ls -tr $PRONAME*.jar | tail -n 1` | |
#echo $FILENAME | |
pkill -f "java -jar $PRONAME" | |
#ps -ef | grep java | |
nohup java -jar $FILENAME >/dev/null 2>log.txt & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment