Jenkinsfile fix: Task fails when gets an error sending email
This commit is contained in:
parent
114c9ded7f
commit
ad03d1edf7
|
@ -97,11 +97,15 @@ pipeline {
|
||||||
always {
|
always {
|
||||||
script {
|
script {
|
||||||
if (!env.GIT_COMMITTER_EMAIL) return
|
if (!env.GIT_COMMITTER_EMAIL) return
|
||||||
mail(
|
try {
|
||||||
to: env.GIT_COMMITTER_EMAIL,
|
mail(
|
||||||
subject: "Pipeline: ${env.JOB_NAME} (${env.BUILD_NUMBER}): ${currentBuild.currentResult}",
|
to: env.GIT_COMMITTER_EMAIL,
|
||||||
body: "Check status at ${env.BUILD_URL}"
|
subject: "Pipeline: ${env.JOB_NAME} (${env.BUILD_NUMBER}): ${currentBuild.currentResult}",
|
||||||
)
|
body: "Check status at ${env.BUILD_URL}"
|
||||||
|
)
|
||||||
|
} catch (e) {
|
||||||
|
echo e.toString()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue