Skip to content

Commit fbb78ac

Browse files
committed
Merge remote-tracking branch 'basil/concurrentBuild'
2 parents 2a98b01 + 1344c0f commit fbb78ac

File tree

7 files changed

+62
-14
lines changed

7 files changed

+62
-14
lines changed

docs/Home.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ Browse the Jenkins issue tracker to see any [open issues](https://issues.jenkins
3535
* 1.76 (unreleased)
3636
* added documentation for pitfalls when using multiple Job DSL build steps in a single job
3737
([JENKINS-44142](https://issues.jenkins-ci.org/browse/JENKINS-44142))
38+
* Fixed [[Dynamic DSL]] problem
39+
([JENKINS-57817](https://issues.jenkins-ci.org/browse/JENKINS-57817))
40+
* Deprecated `concurrentBuild` method in `pipelineJob` context, see [Migration](Migration#migrating-to-176)
41+
([JENKINS-53775](https://issues.jenkins-ci.org/browse/JENKINS-53775))
42+
* Support for older versions of the [Pipeline Job Plugin](https://plugins.jenkins.io/workflow-job) is deprecated, see
43+
[Migration](Migration#migrating-to-169)
3844
* 1.75 (August 12 2019)
3945
* Added documentation about mandatory identifier in multi-branch Pipeline job branch sources, the identifier will no
4046
longer be generated and must be set to a constant and unique value, see [Migration](Migration#migrating-to-175)
@@ -43,8 +49,6 @@ Browse the Jenkins issue tracker to see any [open issues](https://issues.jenkins
4349
([JENKINS-54877](https://issues.jenkins-ci.org/browse/JENKINS-54877))
4450
* Fixed problem with API viewer
4551
([JENKINS-51202](https://issues.jenkins-ci.org/browse/JENKINS-51202))
46-
* Fixed [[Dynamic DSL]] problem
47-
([JENKINS-57817](https://issues.jenkins-ci.org/browse/JENKINS-57817))
4852
* Fixed problems when using multiple Job DSL steps in a single seed job
4953
([JENKINS-29784](https://issues.jenkins-ci.org/browse/JENKINS-29784),
5054
[JENKINS-44142](https://issues.jenkins-ci.org/browse/JENKINS-44142))

docs/Migration.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,37 @@
1+
## Migrating to 1.76
2+
3+
### Pipeline: Job Plugin
4+
5+
Support for versions older than 2.4 of the [Pipeline Job Plugin](https://plugins.jenkins.io/workflow-job) is
6+
[[deprecated|Deprecation-Policy]] and will be removed.
7+
8+
The `concurrentBuild` option for Pipeline jobs causes problems
9+
([JENKINS-53775](https://issues.jenkins-ci.org/browse/JENKINS-53775)). It is [[deprecated|Deprecation-Policy]] and will
10+
be removed. It should be replaced by the `disableConcurrentBuilds` job property.
11+
12+
DSL prior to 1.76
13+
```groovy
14+
pipelineJob('example-1') {
15+
concurrentBuild(false)
16+
}
17+
18+
pipelineJob('example-2') {
19+
concurrentBuild()
20+
}
21+
```
22+
23+
DSL since 1.76
24+
```groovy
25+
pipelineJob('example-1') {
26+
properties {
27+
disableConcurrentBuilds()
28+
}
29+
}
30+
31+
pipelineJob('example-2') {
32+
}
33+
```
34+
135
## Migrating to 1.75
236

337
The `id` option in the Git and GitHub branch source contexts is now mandatory

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/JobParent.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ abstract class JobParent extends Script implements DslFactory {
8383
*/
8484
@Override
8585
WorkflowJob pipelineJob(String name, @DslContext(WorkflowJob) Closure closure = null) {
86+
jm.logPluginDeprecationWarning('workflow-job', '2.4')
8687
processItem(name, WorkflowJob, closure)
8788
}
8889

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
}

job-dsl-core/src/test/groovy/javaposse/jobdsl/dsl/JobParentSpec.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,7 @@ class JobParentSpec extends Specification {
409409
job.name == 'test'
410410
parent.referencedJobs.contains(job)
411411
1 * jobManagement.requirePlugin('workflow-job', true)
412+
1 * jobManagement.logPluginDeprecationWarning('workflow-job', '2.4')
412413
}
413414

414415
def 'multibranchPipelineJob'() {

0 commit comments

Comments
 (0)