Jenkins 发布 web 应用至 Tomcat(shell 方式)
2021-01-17 23:12
标签:port href art workspace extra ctc com node spi 需要 https://plugins.jenkins.io/nodejs/ 插件 Jenkins 发布 web 应用至 Tomcat(shell 方式) 标签:port href art workspace extra ctc com node spi 原文地址:https://www.cnblogs.com/jhxxb/p/13343715.html后台
/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/
前端
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
文章标题:Jenkins 发布 web 应用至 Tomcat(shell 方式)
文章链接:http://soscw.com/index.php/essay/43396.html