Search code examples
jenkinsgroovyjenkins-workflow

Postbuild for pipeline in Jenkins


I am currently working with a pipeline in Jenkins and I was wondering if there was any way to call a "post-pipeline" script, much like the post-build plugins made for freestyle. I want it to run and actually pass whether the pipeline failed or passed to the script.


Solution

  • You can use the catchError step, or various more explicit idioms mentioned in that step’s documentation.