Browse Source

pipeline: Fix teardown check and build result

Properly sets the build status for the non-exceptional code path when
teardown is reached, and fixes the conditional for finding the teardown
stage in the exceptional code path.

Change-Id: I61e01b6920488a330af59ead141842430572876c
master
Dan Duvall 5 years ago
parent
commit
d1c7384085
1 changed files with 10 additions and 1 deletions
  1. +10
    -1
      src/org/wikimedia/integration/PipelineBuilder.groovy

+ 10
- 1
src/org/wikimedia/integration/PipelineBuilder.groovy View File

@ -3,6 +3,7 @@ package org.wikimedia.integration
import org.wikimedia.integration.ExecutionGraph
import org.wikimedia.integration.PatchSet
import org.wikimedia.integration.Pipeline
import org.wikimedia.integration.PipelineStage
class PipelineBuilder implements Serializable {
String configPath
@ -70,6 +71,14 @@ class PipelineBuilder implements Serializable {
}
} else {
def stage = stages[0]
// if we've reached the teardown stage in our normal execution
// path (not after an exception was thrown), the result should
// be a success
if (stage.name == PipelineStage.TEARDOWN) {
ws.currentBuild.result = 'SUCCESS'
}
ws.stage("${pline.name}: ${stage.name}", stage.closure(ws))
}
}
@ -78,7 +87,7 @@ class PipelineBuilder implements Serializable {
// ensure teardown steps are always executed
for (def stage in stack.last()) {
if (stage == "_teardown") {
if (stage == PipelineStage.TEARDOWN) {
stage.closure(ws)()
}
}


|||||||
x
 
000:0
Loading…
Cancel
Save