Skip to content

Commit a290e85

Browse files
yrodierebeikov
authored andcommitted
1 parent 51e556e commit a290e85

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

Jenkinsfile

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,6 @@ import org.hibernate.jenkins.pipeline.helpers.job.JobHelper
1616
@Field final String NODE_PATTERN_BASE = 'Worker&&Containers'
1717
@Field List<BuildEnvironment> environments
1818

19-
// Cancel previous runs automatically by reaching milestones
20-
// See https://issues.jenkins.io/browse/JENKINS-43353
21-
def buildNumber = BUILD_NUMBER as int;
22-
if (buildNumber > 1) {
23-
milestone(buildNumber - 1)
24-
}
25-
milestone(buildNumber)
26-
2719
this.helper = new JobHelper(this)
2820

2921
helper.runWithNotification {
@@ -63,6 +55,9 @@ stage('Configure') {
6355
buildDiscarder(
6456
logRotator(daysToKeepStr: '90')
6557
),
58+
// If two builds are about the same branch or pull request,
59+
// the older one will be aborted when the newer one starts.
60+
disableConcurrentBuilds(abortPrevious: true),
6661
helper.generateNotificationProperty()
6762
])
6863
}

0 commit comments

Comments
 (0)