How to restart from a checkpoint and mutate a build parameter in Pipeline?

Issue

It would be nice to restart from a checkpont, and mutate a build parameter. The use case here is someone clicks “run from this checkpoint” and unchecks the platforms (on by default) they do not wish to rerun.

Environment

  • CloudBees Jenkins Platform
  • Pipeline Plugin

Resolution

This could be handled to the extent that the original property of the return value of the step should be non-null if and only if resuming.

This can be accomplished by doing the following in your Pipeline script:

def cp = checkpoint 'about to run'
def platforms
if (cp.original == null) {
  platforms = 'amd64,linux,solaris,NT'
} else {
  def selections = input …
  platforms = …using selections…
}
sh "make clean all -plats=${platforms}"
Have more questions? Submit a request

2 Comments

  • 0
    Avatar
    Daniel Martin

    Could you put more information as the the issue you are trying to solve, along with better context around the resolution.

  • 0
    Avatar
    James Brown

    Hi Daniel,

    I've updated more of the article with the original ask along with some additional context in the resolution. If you have any additional questions please don't hesitate to raise the same in a case!

Please sign in to leave a comment.