服务端自动打包脚本
#!/bin/sh
cd /d/svn
pwd
svn checkout svn://xxx.xxx.xxx.xxx:xxx/x/code/union --username xxx --password xxx
#cd /d/svn/union
#mvn clean install -Dmaven.test.skip=true
cd /d/svn/union/union-common
/d/maven/apache-maven-3.6.3/bin/mvn clean install -Dmaven.test.skip=true
cd /d/svn/union/umpp
cp -f /d/svn/application-test.yml /d/svn/union/umpp/src/main/resources/application.yml
/d/maven/apache-maven-3.6.3/bin/mvn clean package -Dmaven.test.skip=true
cp -f /d/svn/union/umpp/target/umpp-0.0.1-SNAPSHOT.jar /d/zcpt_server/umpp-test.jar
自动部署脚本
#!/bin/sh
echo '--------开始部署--------'
cd /d/zcpt_server
pid=$(ps -ef|grep umpp-test.jar|grep -v grep|awk '{print $2}')
echo "$pid"
echo "原服务pid: $pid"
if [ -n "$pid" ];then
echo "关闭原服务: $pid"
kill -9 $pid
fi
while [ "$pid" ]
do
echo "正在关闭中: $pid"
sleep 1
pid=$(ps -ef|grep tymes-1.0.0-SNAPSHOT-demoline|grep -v grep|awk '{print $2}')
done
echo '成功关闭服务!'
nohup java -jar /d/zcpt_server/umpp-test.jar > log-test.log 2>&1 &
echo '启动新服务'
网友评论