Issue
It would be nice to restart from a checkpoint, 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.
Resolution
This can be accomplished by storing the original build number before creating a checkpoint, and then comparing the stored build number against the current build number whenever you want to know if the build has resumed:
def origBuildNumber = BUILD_NUMBER checkpoint 'about to run' def platforms if (origBuildNumber == BUILD_NUMBER) { platforms = 'amd64,linux,solaris,NT' } else { // resumed build def selections = input … platforms = …using selections… } node { sh "make clean all -plats=${platforms}" }
This article is part of our Knowledge Base and is provided for guidance-based purposes only. The solutions or workarounds described here are not officially supported by CloudBees and may not be applicable in all environments. Use at your own discretion, and test changes in a safe environment before applying them to production systems.