Skip to content

Instantly share code, notes, and snippets.

@ulich
ulich / jenkins-pipeline-retry-method.groovy
Created June 13, 2016 14:53
Jenkins pipeline utility method that asks the user to retry the given closure and executes a closure on success or user abortion
/**
* Executes given params.task closure and if it fails, asks the user if it should be retried.
* The task will then be executed again. If the user clicks abort, an exception will be
* thrown aborting the pipeline.
*
* After the task either completes successfully or after the user clicks abort,
* the params.andFinally closure will be executed.
*
* Usage:
* <pre><code>