Skip to content

Commit 1344c0f

Browse files
committed
Deprecate support for concurrentBuild in Pipeline jobs
1 parent 6f94dc5 commit 1344c0f

File tree

5 files changed

+57
-12
lines changed

5 files changed

+57
-12
lines changed

docs/Home.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ Browse the Jenkins issue tracker to see any [open issues](https://issues.jenkins
4242
([JENKINS-51202](https://issues.jenkins-ci.org/browse/JENKINS-51202))
4343
* Fixed [[Dynamic DSL]] problem
4444
([JENKINS-57817](https://issues.jenkins-ci.org/browse/JENKINS-57817))
45+
* Deprecated `concurrentBuild` method in `pipelineJob` context, see [Migration](Migration#migrating-to-175)
46+
([JENKINS-53775](https://issues.jenkins-ci.org/browse/JENKINS-53775))
4547
* 1.74 (May 01 2019)
4648
* Fixed [Configuration as Code](https://github.com/jenkinsci/configuration-as-code-plugin/) extension
4749
([JENKINS-57218](https://issues.jenkins-ci.org/browse/JENKINS-57218))

docs/Migration.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,41 @@ multibranchPipelineJob('example') {
2424
}
2525
```
2626

27+
### Pipeline: Job Plugin
28+
29+
The `concurrentBuild` field was deprecated and replaced by
30+
`DisableConcurrentBuildsJobProperty` in
31+
[jenkinsci/workflow-job-plugin#8](https://github.com/jenkinsci/workflow-job-plugin/pull/8),
32+
which was released in Pipeline: Job 2.4. Use of this deprecated field causes
33+
[JENKINS-53775](https://issues.jenkins-ci.org/browse/JENKINS-53775) and should
34+
be replaced with the [[Dynamic DSL]].
35+
36+
#### Disabling concurrent Pipeline builds
37+
38+
DSL prior to 1.75
39+
```groovy
40+
concurrentBuild false
41+
```
42+
43+
DSL since 1.75
44+
```groovy
45+
properties {
46+
disableConcurrentBuilds()
47+
}
48+
```
49+
50+
#### Enabling concurrent Pipeline builds
51+
52+
DSL prior to 1.75
53+
```groovy
54+
concurrentBuild true
55+
```
56+
57+
DSL since 1.75
58+
59+
Simply delete any usages of `concurrentBuild true`. Concurrent builds are
60+
enabled for Pipeline jobs by default.
61+
2762
## Migrating to 1.72
2863

2964
### CloudBees Folders Plugin

job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/Job.groovy

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -224,18 +224,6 @@ abstract class Job extends Item {
224224
}
225225
}
226226

227-
/**
228-
* Allows Jenkins to schedule and execute multiple builds concurrently.
229-
*
230-
* @since 1.21
231-
*/
232-
void concurrentBuild(boolean allowConcurrentBuild = true) {
233-
configure { Node project ->
234-
Node node = methodMissing('concurrentBuild', allowConcurrentBuild)
235-
project / node
236-
}
237-
}
238-
239227
/**
240228
* Compresses the log file after build completion.
241229
*

job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/Project.groovy

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,18 @@ abstract class Project extends Job {
142142
}
143143
}
144144

145+
/**
146+
* Allows Jenkins to schedule and execute multiple builds concurrently.
147+
*
148+
* @since 1.21
149+
*/
150+
void concurrentBuild(boolean allowConcurrentBuild = true) {
151+
configure { Node project ->
152+
Node node = methodMissing('concurrentBuild', allowConcurrentBuild)
153+
project / node
154+
}
155+
}
156+
145157
/**
146158
* Adds batch tasks that are not regularly executed to projects, such as releases, integration, archiving.
147159
* Can be called multiple times to add more batch tasks.

job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/jobs/WorkflowJob.groovy

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,12 @@ class WorkflowJob extends Job {
2626
project << context.definitionNode
2727
}
2828
}
29+
30+
@Deprecated
31+
void concurrentBuild(boolean allowConcurrentBuild = true) {
32+
configure { Node project ->
33+
Node node = methodMissing('concurrentBuild', allowConcurrentBuild)
34+
project / node
35+
}
36+
}
2937
}

0 commit comments

Comments
 (0)