-
-
Save hagzag/4e026f049a0777add0a9d497e6c8fdcb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline { | |
agent { | |
node { | |
label 'collectors-slave' | |
} | |
} | |
stages { | |
stage('Do echo') { | |
steps { | |
sh 'env' | |
//sh 'exit 2' | |
} | |
} | |
} | |
post | |
{ | |
always { | |
script { | |
GIT_COMMIT_EMAIL = sh (script: 'git --no-pager show -s --format=\'%ae\'',returnStdout: true).trim() | |
GIT_COMMIT_HASH_SHORT = sh (script: 'git log -n 1 --pretty=format:\'%h\'',returnStdout: true).trim() | |
GIT_COMMIT_HASH = sh (script: 'git rev-parse HEAD',returnStdout: true) | |
GIT_ORG= sh (script: 'git remote -v | tr \"\/.\" \":\" | cut -d \":\" -f3',returnStdout: true).trim() | |
GIT_REPO= sh (script: 'git remote -v | tr \"\/.\" \":\" | cut -d \":\" -f4',returnStdout: true).trim() | |
BUILD_STATUS = currentBuild.currentResult | |
mail to: 'nadav.daniel@lightapp.com', | |
subject: "Job '${JOB_NAME}' completed with status ${BUILD_STATUS}", | |
body: "${JOB_NAME} initialized by ${GIT_COMMIT_EMAIL} git commit https://github.com/${GIT_ORG}/${GIT_REPO}/commit/${GIT_COMMIT_HASH} server", | |
from: 'larobot@lightapp.com', | |
replyTo: 'larobot@lightapp.com' | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment