infobloxopen / atlas-cli

Apache License 2.0
14 stars 45 forks source link

fix: perform Jenkins cleanup in cleanup block #79

Closed kd7lxl closed 3 years ago

kd7lxl commented 3 years ago

Jenkins specifies that cleanup should be done in the cleanup block: https://www.jenkins.io/doc/book/pipeline/syntax/#post

Previously, atlas-cli was generating a Jenkinsfile that did cleanup in the always block. This can be problematic when there are multiple post conditions. always is always the first post-condition to run. If always cleans up the artifacts before success has a chance to process them, the pipeline will fail. By appropriately using the cleanup block, the cleanup will run after all other operations.