From aa96214cf303e86c8b287e3dd66b46f9d9f2db19 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Sat, 15 Oct 2022 14:29:05 +0200 Subject: [PATCH] fixes #4355 --- Jenkinsfile | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d13c205..b1b3310 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,7 +15,7 @@ pipeline { stages { stage('Checkout') { steps { - sh 'printenv' + setEnv() } } stage('Deploy') { @@ -29,28 +29,8 @@ pipeline { } } post { - always { - script { - if (!env.GIT_COMMITTER_EMAIL) { - env.COMMITTER_EMAIL = sh( - script: 'git --no-pager show -s --format="%ae"', - returnStdout: true - ).trim() - } else { - env.COMMITTER_EMAIL = env.GIT_COMMITTER_EMAIL; - } - - if (!env.COMMITTER_EMAIL) return - try { - mail( - to: env.COMMITTER_EMAIL, - subject: "Pipeline: ${env.JOB_NAME} (${env.BUILD_NUMBER}): ${currentBuild.currentResult}", - body: "Check status at ${env.BUILD_URL}" - ) - } catch (e) { - echo e.toString() - } - } + unsuccessful { + sendEmail() } } -} \ No newline at end of file +}