Deploy notifications to commiter

This commit is contained in:
Juan Ferrer 2019-01-08 16:27:47 +01:00
parent 56efd89fa5
commit b788b251b7
1 changed files with 7 additions and 8 deletions

15
Jenkinsfile vendored
View File

@ -16,12 +16,11 @@ try {
node { node {
stage ('Checkout') { stage ('Checkout') {
checkout scm checkout scm
echo env.GIT_COMMITTER_NAME env.GIT_COMMIT_EMAIL = sh (
echo env.GIT_AUTHOR_NAME script: "git --no-pager show -s --format='%ae'",
echo env.GIT_USER returnStdout: true
echo env.CHANGE_AUTHOR ).trim()
echo env.CHANGE_AUTHOR_DISPLAY_NAME echo "Commiter: ${env.GIT_COMMIT_EMAIL}"
echo env.CHANGE_AUTHOR_EMAIL
} }
stage ('Build') { stage ('Build') {
nodejs('node-lts') { nodejs('node-lts') {
@ -56,13 +55,13 @@ try {
} }
mail( mail(
to: 'juan@verdnatura.es', to: env.GIT_COMMIT_EMAIL,
subject: "Pipeline success: ${env.JOB_NAME} (${env.BUILD_NUMBER})", subject: "Pipeline success: ${env.JOB_NAME} (${env.BUILD_NUMBER})",
body: "Check status at ${env.BUILD_URL}" body: "Check status at ${env.BUILD_URL}"
) )
} catch(e) { } catch(e) {
mail( mail(
to: 'juan@verdnatura.es', to: env.GIT_COMMIT_EMAIL,
subject: "Pipeline failed: ${env.JOB_NAME} (${env.BUILD_NUMBER})", subject: "Pipeline failed: ${env.JOB_NAME} (${env.BUILD_NUMBER})",
body: "Check status at ${env.BUILD_URL}" body: "Check status at ${env.BUILD_URL}"
) )