Jenkins build 後 war 包複製到 tomcat 下,啓不來web
添加 :export BUILD_ID=dontKillMetomcat
/usr/local/iron/tomcat8085/bin/shutdown.sh rm -r -f /usr/local/iron/tomcat8085/webapps/audit* cp -f /var/lib/jenkins/workspace/CPA-Service/Service/air-ws-jkwsk/target/audit.war /usr/local/iron/tomcat8085/webapps/ export BUILD_ID=dontKillMe /usr/local/iron/tomcat8085/bin/startup.sh
腳本簡單,沒有單獨寫 .sh 文件app
執行後日志以下webapp
tomcat 下 ,war包解壓成功。注意設置 tomcat 的擁有者設置,jenkinks 默認是 jenkinks用戶操做。也能夠改爲root(沒試過)ui