From b788b251b7fa65292db4832ac41563e804fb2b8d Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 8 Jan 2019 16:27:47 +0100 Subject: [PATCH] Deploy notifications to commiter --- Jenkinsfile | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d8c8fa212..390be194e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,12 +16,11 @@ try { node { stage ('Checkout') { checkout scm - echo env.GIT_COMMITTER_NAME - echo env.GIT_AUTHOR_NAME - echo env.GIT_USER - echo env.CHANGE_AUTHOR - echo env.CHANGE_AUTHOR_DISPLAY_NAME - echo env.CHANGE_AUTHOR_EMAIL + env.GIT_COMMIT_EMAIL = sh ( + script: "git --no-pager show -s --format='%ae'", + returnStdout: true + ).trim() + echo "Commiter: ${env.GIT_COMMIT_EMAIL}" } stage ('Build') { nodejs('node-lts') { @@ -56,13 +55,13 @@ try { } mail( - to: 'juan@verdnatura.es', + to: env.GIT_COMMIT_EMAIL, subject: "Pipeline success: ${env.JOB_NAME} (${env.BUILD_NUMBER})", body: "Check status at ${env.BUILD_URL}" ) } catch(e) { mail( - to: 'juan@verdnatura.es', + to: env.GIT_COMMIT_EMAIL, subject: "Pipeline failed: ${env.JOB_NAME} (${env.BUILD_NUMBER})", body: "Check status at ${env.BUILD_URL}" )