I have a pipeline with multiple steps, for example:
stage \'dev - compile\'
node(\'master\') {
//do something
}
stage \'test- compile\'
node(\'master\') {
I think it is a better way to use the jenkins build in post section instead of using try catch:
pipeline {
agent any
stages {
stage('whatever') {
steps {
...
}
}
}
post {
always {
step([$class: 'Mailer',
notifyEveryUnstableBuild: true,
recipients: "example@example.com",
sendToIndividuals: true])
}
}
}
}
}