Added email notifaction

This commit is contained in:
BrahmanapallyNagaraju 2020-04-08 23:52:01 +05:30 committed by GitHub
parent 819aa7a7ae
commit 41f0d67752
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

13
Jenkinsfile vendored
View file

@ -1,3 +1,7 @@
def targetMail = "bnagaraju96756@gmail.com,jenkinsautomationuser@gmail.com"
def emailDevOps(targetMail, msg) {
emailext body: "${msg}\nplease look into the build: ${BUILD_URL}", subject: "${currentBuild.result}: ${BUILD_TAG}", to: "${targetMail}"
}
pipeline { pipeline {
agent {label "slave"} agent {label "slave"}
stages { stages {
@ -6,7 +10,7 @@ stages {
sh "pwd" sh "pwd"
sh "ls -lrtha" sh "ls -lrtha"
dir("spring-petclinic") { dir("spring-petclinic") {
sh "./mvnw package" sh "./mvnw clean package"
} }
} }
} }
@ -22,4 +26,11 @@ stages {
} }
} }
} }
post {
always{
deleteDir()
emailDevOps(targetMail, "This is the mail notification.")
}
}
} }