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

4
Jenkinsfile vendored
View File

@ -97,11 +97,15 @@ pipeline {
always {
script {
if (!env.GIT_COMMITTER_EMAIL) return
try {
mail(
to: env.GIT_COMMITTER_EMAIL,
subject: "Pipeline: ${env.JOB_NAME} (${env.BUILD_NUMBER}): ${currentBuild.currentResult}",
body: "Check status at ${env.BUILD_URL}"
)
} catch (e) {
echo e.toString()
}
}
}
}