Skip to content
Permalink
Browse files

enhanced support for the Multijob plugin

[FIXES JENKINS-44711]
  • Loading branch information
daspilker committed Jun 20, 2017
1 parent 50319dd commit 6c76e82a01fb253a679dc94a67c368949721940e
@@ -44,6 +44,8 @@ Browse the Jenkins issue tracker to see any [open issues](https://issues.jenkins
([JENKINS-44357](https://issues.jenkins-ci.org/browse/JENKINS-44357))
* Enhanced support for [Sectioned View Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Sectioned+View+Plugin)
([#1037](https://github.com/jenkinsci/job-dsl-plugin/pull/1037))
* Enhanced support for the [Multijob Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Multijob+Plugin)
([JENKINS-44711](https://issues.jenkins-ci.org/browse/JENKINS-44711))
* Support for older versions of the
[HTML Publisher Plugin](https://wiki.jenkins-ci.org/display/JENKINS/HTML+Publisher+Plugin) is deprecated, see
[Migration](Migration#migrating-to-164)
@@ -11,6 +11,18 @@ class MultiJob extends Job {
super(jobManagement, name)
}

/**
* Triggers a build if an SCM change is detected in a subjob. Defaults to {@code false}.
*
* @since 1.64
*/
void pollSubjobs(boolean pollSubjobs = true) {
configure { Node project ->
Node node = methodMissing('pollSubjobs', pollSubjobs)
project / node
}
}

void steps(@DslContext(MultiJobStepContext) Closure closure) {
MultiJobStepContext context = new MultiJobStepContext(jobManagement, this)
ContextHelper.executeInContext(closure, context)
@@ -16,4 +16,15 @@ class MultiJobSpec extends Specification {
then:
job.node.builders[0].children()[0].name() == 'com.tikal.jenkins.plugins.multijob.MultiJobBuilder'
}

def 'call pollSubjobs'() {
when:
job.pollSubjobs(value)

then:
job.node.pollSubjobs[0].value() == value

where:
value << [true, false]
}
}

0 comments on commit 6c76e82

Please sign in to comment.
You can’t perform that action at this time.