griddynamics / mpl

[IT-36925] Jenkins Shared Modular Pipeline Library
https://blog.griddynamics.com/developing-a-modular-pipeline-library-to-improve-devops-collaboration/
Apache License 2.0
157 stars 97 forks source link

Post-Module & Post-Stage execution #17

Closed sparshev closed 5 years ago

sparshev commented 5 years ago

Right now MPL supports only post-pipeline execution steps, but seems it will be useful to introduce new mechanisms to have post-module & post-stage executions.

Example: to collect reports or artifacts before the stage-agent will be destroyed even if there is an error happened during module/stage execution.

Anyone else see benefits of such feature?

sparshev commented 5 years ago

Ok, seems it could be implemented relatively easy, but there is no need to post-stage execution (could be supported using already implemented MPLPostStep and stage post).

So, I will add additional step MPLModulePostStep(closure) that will be bound to the current module (don't want to add another interface for potential cross-module communication). MPLManager interface will support any module name and you can use it with your own step in the nested library.