后台
/opt/tomcat-9.0.35/bin/shutdown.sh sleep 3s ps -ef | grep tomcat | grep -v 'grep.*color=auto' | awk '{print $2}' | xargs kill -9 rm -rf /opt/tomcat-9.0.35/logs/app if [ -d "/opt/tomcat-9.0.35/webapps/spis/app/" ];then cp -r /opt/tomcat-9.0.35/webapps/spis/app/ /opt/tomcat-9.0.35/logs/ fi rm -rf /opt/tomcat-9.0.35/webapps/spis rm -rf /opt/tomcat-9.0.35/webapps/spis.war cp /opt/jenkins/workspace/spis/spis-server/target/spis.war /opt/tomcat-9.0.35/webapps/spis.war OLD_BUILD_ID=$BUILD_ID echo $OLD_BUILD_ID export BUILD_ID=dontKillMe /opt/tomcat-9.0.35/bin/startup.sh export BUILD_ID=$OLD_BUILD_ID echo $BUILD_ID sleep 5s mv /opt/tomcat-9.0.35/logs/app/ /opt/tomcat-9.0.35/webapps/spis/app/
前端
需要 https://plugins.jenkins.io/nodejs/ 插件
npm run clean:dist npm run ng build --prod --aot=false --build-optimizer=false --optimization --progress --extractCss rm -rf /opt/tomcat-9.0.35/webapps/spis/app mv ./dist /opt/tomcat-9.0.35/webapps/spis/app