fix:Jenkinsfile更新
This commit is contained in:
parent
219aa1a8c0
commit
fec31a0079
18
Jenkinsfile
vendored
18
Jenkinsfile
vendored
|
@ -31,7 +31,7 @@ pipeline {
|
|||
//choice(choices:"master", description:"请填写git分支",name:"branch")
|
||||
string(defaultValue:"jeecg-system-start-3.5.1.jar", description:"jar包名称",name:"jarName")
|
||||
string(defaultValue:"alysisSystemForRadionuclide", description:"项目名称",name:"projectName")
|
||||
string(defaultValue:"/var/lib/jenkins/workspace/alysisSystemForRadionuclide", description:"expect_scp可运行脚本地址",name:"expectScpPath")
|
||||
string(defaultValue:"/home/zhaohy/test/expect_scp", description:"expect_scp可运行脚本地址",name:"expectScpPath")
|
||||
string(defaultValue:"/home/zhaohy/test/expect_ssh", description:"expect_ssh可运行脚本地址",name:"expectSsh")
|
||||
string(defaultValue:"192.168.0.115", description:"scp发送文件的服务器地址",name:"scpHost")
|
||||
string(defaultValue:"zhaohy", description:"scp发送服务器的用户名",name:"scpUserName")
|
||||
|
@ -44,15 +44,15 @@ pipeline {
|
|||
stage('打包') {
|
||||
steps {
|
||||
sh "pwd"
|
||||
sh "cd ${params.projectName}/ && mvn clean package -Dmaven.test.skip=true"
|
||||
}
|
||||
}
|
||||
stage('部署') {
|
||||
steps {
|
||||
sh "pwd"
|
||||
sh "cd ${params.projectName}/ && ${params.expectScpPath} target/*.jar ${params.scpTargetPath}"
|
||||
sh "mvn clean package -Dmaven.test.skip=true"
|
||||
}
|
||||
}
|
||||
// stage('部署') {
|
||||
// steps {
|
||||
// sh "pwd"
|
||||
// sh "cd ${params.projectName}/ && ${params.expectScpPath} ${params.scpHost} ${params.scpUserName} ${params.scpPwd} target/*.jar ${params.scpTargetPath}"
|
||||
// }
|
||||
// }
|
||||
// stage('备份') {
|
||||
// steps {
|
||||
// sh "${params.expectSsh} ${params.scpHost} ${params.scpUserName} ${params.scpPwd} \'cd ${params.scpTargetPath};cp ${params.jarName} backup/${params.projectName}_\$(date +%F-%T).jar\'"
|
||||
|
@ -60,7 +60,7 @@ pipeline {
|
|||
// }
|
||||
stage('重启') {
|
||||
steps {
|
||||
sh "pid=\$(ps -ef|grep $jarName |egrep -v grep|awk '{print \$2}');kill -9 \$pid;nohup java -jar ${params.jarName} >/var/lib/jenkins/workspace/null 2>&1 &\'"
|
||||
sh "pid=\$(ps -ef|grep $jarName |egrep -v grep|awk '{print \$2}');kill -9 \$pid;nohup java -jar ${params.jarName} >/dev/null 2>&1 &\'"
|
||||
// sh "rm -rf *"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user