I am using Jenkins declarative pipeline and want to perform some post build actions depending on the build status.
To be more precise, I want to send an email when the build status changed (from success to failure, or success to unstable, or failure to success).
Here is my pipeline:
pipeline {
agent none
stages {
stage('test') {
agent any
steps {
sh './tests.sh'
}
}
}
post {
changed {
// Send different emails depending on build status
// Success -> anything else
// Anything else -> Success
}
}
}
Any idea ?
changedin your question. Why don't you use that? - StephenKing