Skip to content

Commit

Permalink
build(jenkins): add restart step
Browse files Browse the repository at this point in the history
  • Loading branch information
YDKD committed Apr 12, 2022
1 parent 8b1595a commit 5fa3706
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,26 @@ pipeline {
}
}

stage('restart container') {

when {
anyOf {
branch 'dev'
}
}
agent {
docker {
image 'node:14.18.0'
reuseNode true
}
}

steps {
sh 'restart'
sh './jenkins/script/restart.sh'
}
}

stage("artifacts-manage"){
when {
expression{
Expand All @@ -130,13 +150,13 @@ pipeline {
expression{
return fileExists("${resetFlagFile}")
}
anyOf {
anyOf {
branch 'dev'
branch 'release'
branch 'master'
}
}

steps {
echo "是回滚啊啊啊啊"
//当然我们这里为了方便下载
Expand Down Expand Up @@ -174,7 +194,7 @@ pipeline {
}

//post 就是流水线的运行结果状态啦,我们慢点会在这里设置邮件通
post {
post {
changed{
echo 'I changed!'
}
Expand All @@ -187,7 +207,7 @@ pipeline {
emailext(
subject: "Job [${env.JOB_NAME}] - Status: fail",
body: """${template}""",
recipientProviders: [culprits(),requestor(),developers()],
recipientProviders: [culprits(),requestor(),developers()],
to: "[email protected]",
)
}
Expand All @@ -203,7 +223,7 @@ pipeline {
emailext(
subject: "Job [${env.JOB_NAME}] - Status: Success",
body: """${template}""",
recipientProviders: [requestor(),developers()],
recipientProviders: [requestor(),developers()],
to: "[email protected]",
)
}
Expand Down

0 comments on commit 5fa3706

Please sign in to comment.