Initial commit

This commit is contained in:
Juan Ferrer 2020-01-30 15:56:08 +01:00
commit 43f8af6304
3 changed files with 23 additions and 0 deletions

0
LICENSE Executable file
View File

0
README.md Executable file
View File

23
var/util.groovy Normal file
View File

@ -0,0 +1,23 @@
#!/usr/bin/env groovy
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;
}
def sendEmail() {
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()
}
}