Reputation: 2763
Currently, in Jenkins Job Builder, I can specify downstream jobs through the publishers option like this:
- job-template:
name: foo-one
project-type: freestyle
disabled: false
...
publishers:
- pipeline:
project: foo-two
When the foo-one job is created, the downstream connection exists within Jenkins but the Build other projects entry is 'Build other projects (Manual Step)'. How do I indicate through Jenkins Job Builder that the downstream connection to job foo-two needs to be automated?
Upvotes: 1
Views: 929
Reputation: 6768
Try using trigger-parameterized-builds
for triggering downstream jobs.
- job-template:
name: foo-one
project-type: freestyle
disabled: false
...
publishers:
- trigger-parameterized-builds:
- project: 'foo-two'
condition: UNSTABLE_OR_BETTER
fail-on-missing: true
Upvotes: 0
Reputation: 2763
Could not figure out how to resolve the issue using Jenkins Job Builder publisher/pipeline tag. So, ended up:
Using the Jenkins Job Builder xml and publisher tags:
- job-template:
name: foo-one
project-type: freestyle
disabled: false
...
publishers:
- raw:
xml: |
<hudson.tasks.BuildTrigger>
<childProjects>foo-two</childProjects>
<threshold>
<name>SUCCESS</name>
<ordinal>0</ordinal>
<completeBuild>true</completeBuild>
</threshold>
</hudson.tasks.BuildTrigger>
Upvotes: 1