From 450df7876d5dde1cb8550870ea0c524c810b8a18 Mon Sep 17 00:00:00 2001 From: Tre' Seymour Date: Wed, 3 Jun 2020 17:04:50 -0600 Subject: [PATCH] Add fail h --- .ci/Jenkinsfile_coverage | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.ci/Jenkinsfile_coverage b/.ci/Jenkinsfile_coverage index a64a9062c54c3..5e128aae4fa9a 100644 --- a/.ci/Jenkinsfile_coverage +++ b/.ci/Jenkinsfile_coverage @@ -16,11 +16,7 @@ kibanaPipeline(timeoutMinutes: 240) { kibanaCoverage.runTests() handleIngestion(TIME_STAMP) } - - if (params.NOTIFY_ON_FAILURE) { - kibanaPipeline.bash('echo "### Something failed"', '### On Failure Print') - kibanaCoverage.onFailure() - } + handleFail() } } kibanaPipeline.sendMail() @@ -37,4 +33,10 @@ def handleIngestion(timestamp) { kibanaCoverage.uploadCoverageStaticSite(timestamp) } +def handleFail() { + def buildStatus = buildUtils.getBuildStatus() + if(params.NOTIFY_ON_FAILURE && buildStatus != 'SUCCESS' && buildStatus != 'ABORTED') { + kibanaCoverage.onFailure() + } +}