代码拉取完成,页面将自动刷新
pipeline {
agent any
stages {
stage('Build') {
steps {
echo "env: ${env.BRANCH_NAME}"
echo "Building.."
sh "/opt/maven/bin/mvn package -Dmaven.test.skip=true -P${env.BRANCH_NAME}"
}
}
stage('Test') {
steps {
echo "env: ${env.BRANCH_NAME}"
echo 'Testing..'
}
}
stage('Deploy') {
steps {
echo "env: ${env.BRANCH_NAME}"
echo "mrcms-${env.BRANCH_NAME} docker stop...."
sh '''
ssh root@ww-server-15 "docker stop mrcms-${BRANCH_NAME}"
echo "douruimi-web bakup...."
if [ ! -f "/opt/data/tomcat/mrcms/$BRANCH_NAME.war" ];then
echo "文件不存在"
else
mv /opt/data/tomcat/mrcms/$BRANCH_NAME.war /opt/data/tomcat/app-$(date +%Y%m%d%h%m%s).war
fi
scp ./target/mrcms-1.0.0.war root@ww-server-15:/opt/data/tomcat/mrcms/ROOT.war
echo "mrcms-${BRANCH_NAME} docker deploying...."
echo "mrcms-${BRANCH_NAME} docker start...."
ssh root@ww-server-15 "docker start mrcms-${BRANCH_NAME}"
'''
}
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。