Skip to content

Commit

Permalink
chore: send mail notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
olimpiurob committed Apr 8, 2024
1 parent e41bb91 commit fd31bc5
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ pipeline {
dockerhubrepo = "eeacms/reportek-base-dr"
DEPENDENT_DOCKERFILE_URL="eea/eea.docker.reportek.mdr-instance/blob/master/Dockerfile eea/eea.docker.reportek.cdr-instance/blob/master/Dockerfile eea/eea.docker.reportek.bdr-instance/blob/master/Dockerfile"
}

stages {

stage('Release') {
when {
branch 'master'
Expand All @@ -21,7 +21,7 @@ pipeline {
}
}
}

stage('Release on tag creation') {
when {
buildingTag()
Expand All @@ -40,22 +40,15 @@ pipeline {
}

post {
changed {
always {
script {
def url = "${env.BUILD_URL}/display/redirect"
def status = currentBuild.currentResult
def subject = "${status}: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'"
def summary = "${subject} (${url})"
def details = """<h1>${env.JOB_NAME} - Build #${env.BUILD_NUMBER} - ${status}</h1>
<p>Check console output at <a href="${url}">${env.JOB_BASE_NAME} - #${env.BUILD_NUMBER}</a></p>
"""

def color = '#FFFF00'
if (status == 'SUCCESS') {
color = '#00FF00'
} else if (status == 'FAILURE') {
color = '#FF0000'
}
emailext (subject: subject, attachLog: true, compressLog: true, to: '[email protected]', body: details)
}
}
}
Expand Down

0 comments on commit fd31bc5

Please sign in to comment.