From afdf1df90993d59fbf58e761af186bfccf73e1d8 Mon Sep 17 00:00:00 2001 From: Peter van 't Hof Date: Thu, 19 Jan 2017 14:43:13 +0100 Subject: [PATCH] Fix abort option in pipeline for slack --- Jenkinsfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ec7794c4f..3d50c77fc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -31,8 +31,10 @@ node('local') { } } catch (e) { - currentBuild.result = "FAILED" - slackSend (color: '#FF0000', message: "FAILED: Job '${env.JOB_NAME} #${env.BUILD_NUMBER}' (<${env.BUILD_URL}|Open>)", channel: '#biopet-bot', teamDomain: 'lumc', tokenCredentialId: 'lumc') + if(currentBuild.result != null && !"FAILED".equals(currentBuild.result)) { + currentBuild.result = "FAILED" + } + slackSend (color: '#FF0000', message: "${currentBuild.result}: Job '${env.JOB_NAME} #${env.BUILD_NUMBER}' (<${env.BUILD_URL}|Open>)", channel: '#biopet-bot', teamDomain: 'lumc', tokenCredentialId: 'lumc') throw e } -- GitLab