Code refactor

This commit is contained in:
Juan Ferrer 2020-01-31 13:29:58 +01:00
parent 4f7aaca9d6
commit 3a1a37aa09
2 changed files with 15 additions and 14 deletions

14
vars/sendEmail.groovy Normal file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env groovy
def call() {
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;
}
sh 'printenv'
}

View File

@ -1,19 +1,6 @@
#!/usr/bin/env groovy
def setEnv() {
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;
}
sh 'printenv'
}
def sendEmail() {
def call() {
if (!env.COMMITTER_EMAIL) return
try {
mail(