From 5845ed0bf9485f1b0bce535179fb922c6e98e87a Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Thu, 30 Jan 2020 16:39:20 +0100 Subject: [PATCH] Jenkinsfile using common library --- Jenkinsfile | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e67abb2..4945f56 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,17 +9,8 @@ pipeline { stage('Checkout') { steps { 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; - } + util.setEnv() } - - sh 'printenv' } } stage('Build') { @@ -47,16 +38,7 @@ pipeline { post { always { script { - 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() - } + util.sendEmail() } } }