Jenkinsfile fix: Task fails when gets an error sending email

This commit is contained in:
Juan Ferrer 2019-01-16 16:05:43 +01:00
parent 114c9ded7f
commit ad03d1edf7
1 changed files with 9 additions and 5 deletions

14
Jenkinsfile vendored
View File

@ -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()
}
} }
} }
} }