Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #1038 from daspilker/JENKINS-44711
[JENKINS-44711] enhanced support for the Multijob plugin
  • Loading branch information
daspilker committed Jun 20, 2017
2 parents ebedd98 + 6c76e82 commit 6a0a62f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/Home.md
Expand Up @@ -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)
Expand Down
Expand Up @@ -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)
Expand Down
Expand Up @@ -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 6a0a62f

Please sign in to comment.