-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major
-
Component/s: blueocean-pipeline-editor-plugin
-
iapetus, 1.0, Blue Ocean 1.0-rc3, Blue Ocean 1.0-rc4, Blue Ocean - 1.1-beta-1, Blue Ocean - 1.1-beta2, Blue Ocean 1.1-beta4
Post steps
- Runs after a stage has finished executing
- Runs after a pipeline has finished executing
Can run when:
- Always - even if the steps before the post steps fail, the post steps will always run
- Failed - runs only when the proceeding steps have failed
- Success - runs only when the proceeding steps have passed
- unstable - runs only when the proceeding steps have been marked as unstable
- changed - runs only when the state has changed relative to the previous run
- e.g. stage "foo" was success in run 1, then fails in run 2 would these steps ever be run
https://jenkins.io/doc/pipeline/tour/post/
Example
pipeline {
agent any
stages {
stage('No-op') {
steps {
sh 'ls'
}
}
}
post {
always {
echo 'One way or another, I have finished'
deleteDir() /* clean up our workspace */
}
success {
echo 'I succeeeded!'
}
unstable {
echo 'I am unstable :/'
}
failure {
echo 'I failed :('
}
changed {
echo 'Things were different before...'
}
}
}