后台服务接入Jenkins

This commit is contained in:
luozhun 2024-10-31 11:03:00 +08:00
parent 44bff02808
commit ddc474d2d0
1 changed files with 2 additions and 2 deletions

View File

@ -15,7 +15,7 @@ pipeline {
stage('构建后台服务') { stage('构建后台服务') {
steps{ steps{
echo '开始构建后台服务' echo '开始构建后台服务'
sh 'cd /var/jenkins_home/workspace/policeSecurity/policeSecurityServer && mvn clean -DskipTests=true package -P prod' sh 'cd /var/jenkins_home/workspace/警保联动后端服务/policeSecurityServer && mvn clean -DskipTests=true package -P prod'
echo '后台服务构建完成' echo '后台服务构建完成'
} }
} }
@ -34,7 +34,7 @@ pipeline {
sshCommand remote: remote, command: 'pwd=$(pwd) echo "ssh连接成功当前工作目录$(pwd)"' sshCommand remote: remote, command: 'pwd=$(pwd) echo "ssh连接成功当前工作目录$(pwd)"'
sshCommand remote: remote, command: 'echo "将构建的server.jar发送到服务器..."' sshCommand remote: remote, command: 'echo "将构建的server.jar发送到服务器..."'
sshPut remote: remote, from: '/var/jenkins_home/workspace/policeSecurity/policeSecurityServer/target/policeSecurityServer.jar', into: '/home/javaProject/policeSecurity/logs' sshPut remote: remote, from: '/var/jenkins_home/workspace/警保联动后端服务/policeSecurityServer/target/policeSecurityServer.jar', into: '/home/javaProject/policeSecurity/logs'
sshCommand remote: remote, command: 'echo "server.jar发送成功!"' sshCommand remote: remote, command: 'echo "server.jar发送成功!"'
} }
} }