You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 18, 2023. It is now read-only.
Currently, the pipeline post section executed on failure tries perform several actions (spanning from archiving the artifacts to destroying the domain) not taking into account the stage it failed on.
This usually causes another failures being raised during the teardown itself, making the failure root cause being buried under a lot of unnecessary logs and failure messages.
If we could keep track of the pipeline progress, e.g. by keeping a simple stage number flag, we could use this var during the teardown to identify only the applicable teardown steps.
e.g.
/* this is just a pseudo-code, don't expect it to be functional, it's just to demonstrate the logic */
stage('create vm'){
recent_stage = 0;
..stage code...
}
stage('install katello'){
recent_stage = 1;
..stage code...
}
stage('run tests'){
recent_stage = 2;
..stage code...
}
stage('run something else'){
recent_stage = 3;
..stage code...
}
post {
failure {
teardown_steps = ['destroy_vm', 'archive_artifacts', 'something_else'];
if(recent_stage > 0){
for(i=teardown_steps.size - recent_stage; i < teardown_steps.size; i++){
println(teardown_steps.reverse()[i]);
eval(teardown_steps[-i]);
}
}
}
}
}
The text was updated successfully, but these errors were encountered:
Currently, the pipeline
post
section executed onfailure
tries perform several actions (spanning from archiving the artifacts to destroying the domain) not taking into account the stage it failed on.This usually causes another failures being raised during the teardown itself, making the failure root cause being buried under a lot of unnecessary logs and failure messages.
If we could keep track of the pipeline progress, e.g. by keeping a simple stage number flag, we could use this var during the teardown to identify only the applicable teardown steps.
e.g.
The text was updated successfully, but these errors were encountered: