Jenkinsfile using common library
gitea/vn-support/master This commit looks good Details

This commit is contained in:
Juan Ferrer 2020-01-30 16:39:20 +01:00
parent 5251adff2f
commit 5845ed0bf9
1 changed files with 2 additions and 20 deletions

22
Jenkinsfile vendored
View File

@ -9,18 +9,9 @@ pipeline {
stage('Checkout') { stage('Checkout') {
steps { steps {
script { script {
if (!env.GIT_COMMITTER_EMAIL) { util.setEnv()
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'
}
} }
stage('Build') { stage('Build') {
when { when {
@ -47,16 +38,7 @@ pipeline {
post { post {
always { always {
script { script {
if (!env.COMMITTER_EMAIL) return util.sendEmail()
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()
}
} }
} }
} }