From 85b3ce02508e662bf45a28f03b68cfe695815168 Mon Sep 17 00:00:00 2001 From: Brian Seeders Date: Fri, 13 Sep 2019 15:15:49 -0400 Subject: [PATCH] Fix a few issues related to sending emails in pipeline (#45470) --- Jenkinsfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3f71f19a58e2..dc47b7b1bac8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -41,6 +41,10 @@ stage("Kibana Pipeline") { // This stage is just here to help the BlueOcean UI a ]) } node('flyweight') { + // If the build doesn't have a result set by this point, there haven't been any errors and it can be marked as a success + // The e-mail plugin for the infra e-mail depends upon this being set + currentBuild.result = currentBuild.result ?: 'SUCCESS' + sendMail() } } @@ -240,9 +244,8 @@ def sendKibanaMail() { catchError { if(params.NOTIFY_ON_FAILURE && currentBuild.result != 'SUCCESS' && currentBuild.result != 'ABORTED') { emailext( - // to: 'build-kibana@elastic.co', - to: 'brian.seeders@elastic.co', // TODO switch this out after testing - subject: "${env.PROJECT_NAME} - Build # ${env.BUILD_NUMBER} - ${currentBuild.result}", + to: 'build-kibana@elastic.co', + subject: "${env.JOB_NAME} - Build # ${env.BUILD_NUMBER} - ${currentBuild.result}", body: '${SCRIPT,template="groovy-html.template"}', mimeType: 'text/html', )