提交 0cbe991d 编写于 作者: Q quicksilver

add email notify function


Former-commit-id: c0a49190549a6dbe81525c1b368289ee6afd8956
上级 184274ed
def notify() {
if (!currentBuild.resultIsBetterOrEqualTo('SUCCESS')) {
// Send an email only if the build status has changed from green/unstable to red
emailext subject: '$DEFAULT_SUBJECT',
body: '$DEFAULT_CONTENT',
recipientProviders: [
[$class: 'DevelopersRecipientProvider'],
[$class: 'RequesterRecipientProvider']
],
replyTo: '$DEFAULT_REPLYTO',
to: '$DEFAULT_RECIPIENTS'
}
}
return this
...@@ -232,6 +232,12 @@ spec: ...@@ -232,6 +232,12 @@ spec:
} }
post { post {
always {
script {
def notify = load "${env.WORKSPACE}/ci/jenkinsfile/notify.groovy"
notify.notify()
}
}
success { success {
script { script {
updateGitlabCommitStatus name: 'CI/CD', state: 'success' updateGitlabCommitStatus name: 'CI/CD', state: 'success'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册