Cancel old pipeline runs if a new commit arrives before the old build finishes
This commit is contained in:
parent
cef7988528
commit
bcc33a76cb
|
@ -16,6 +16,14 @@ import org.hibernate.jenkins.pipeline.helpers.job.JobHelper
|
|||
@Field final String NODE_PATTERN_BASE = 'Worker&&Containers'
|
||||
@Field List<BuildEnvironment> environments
|
||||
|
||||
// Cancel previous runs automatically by reaching milestones
|
||||
// See https://issues.jenkins.io/browse/JENKINS-43353
|
||||
def buildNumber = BUILD_NUMBER as int;
|
||||
if (buildNumber > 1) {
|
||||
milestone(buildNumber - 1)
|
||||
}
|
||||
milestone(buildNumber)
|
||||
|
||||
this.helper = new JobHelper(this)
|
||||
|
||||
helper.runWithNotification {
|
||||
|
|
Loading…
Reference in New Issue