----Branches to build-----------
*/master
----轮询 SCM-----------
*/1 * * * *
----Root POM-----------
szrobot/pom.xml
----Goals and options-----------
clean package -Dmaven.test.skip=true
----Source files-----------
szrobot/target/*.jar
----Remove prefix-----------
szrobot/target
----Remote directory-----------
/app/www/dst/jar/test
----Exec command-----------
netstat -antpu | grep 8890 | awk '{print $7}' | awk -F"/" '{print $1}' | xargs -I{} kill -9 {}
/bin/rm -rf /app/www/dst/jar/dst-fm-szrobot-test/*
mv /app/www/dst/jar/test/szrobot.jar /app/www/dst/jar/dst-fm-szrobot-test
cd /app/www/dst/jar/dst-fm-szrobot-test
source /etc/profile
setsid java -jar szrobot.jar --spring.profiles.active=test >/dev/null 2>&1 &
动态参数构建:
ps aux | grep $name.jar | grep -v grep | awk '{print $2}' | head -1 | xargs -I{} kill -9 {}
/bin/rm -rf $path/$name/*
mv $path/$name.jar $path/$name
cd $path/$name
source /etc/profile
setsid java -jar $name.jar --spring.profiles.active=dev >/dev/null 2>&1 &