Skip to content

Commit

Permalink
Merge pull request #19 from jglick/JENKINS-43353-revision
Browse files Browse the repository at this point in the history
Alternate workaround for JENKINS-43353 which seems more efficient
  • Loading branch information
amuniz committed May 6, 2019
2 parents c48dcb7 + 11a8331 commit 4751bb5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void killPrecedingBuild() {
story.addStep(new Statement() {
@Override public void evaluate() throws Throwable {
WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "p");
p.setDefinition(new CpsFlowDefinition("for (int i = 0; i < (BUILD_NUMBER as int); i++) {milestone()}; semaphore 'run'", true));
p.setDefinition(new CpsFlowDefinition("def buildNumber = BUILD_NUMBER as int; if (buildNumber > 1) milestone(buildNumber - 1); milestone(buildNumber); semaphore 'run'", true));
{
WorkflowRun b1 = p.scheduleBuild2(0).waitForStart();
SemaphoreStep.waitForStart("run/1", b1);
Expand Down

0 comments on commit 4751bb5

Please sign in to comment.