![Christoffer Skeppstedt](/assets/img/avatar_default.png)
When configuring the trigger_builds Builder in the Jenkins web interface, you can add the parameter "Pass-through Git Commit that was built". You could not configure this in a jobs.yml. This commit adds that functionality (both to the builder "trigger_builds " and the publisher "trigger_parameterized_builds"). I still want to be backwards compatible with the old version (true/false) and maintain the similarity with the svn-revision param. Which means that you can either configure it as git-revision: true/false or git-revision: combine-queued-commits: true/false There were no prior case of shared code between builders and publishers, so (by recommendation) I put the common logic in builders.py, and then imported it in publishers.py. I added thorough tests for the feature in the builders fixtures, and only a basic test in the publishers fixtures, as suggested. Change-Id: I72cdcae3fac1094ffcc9367369556b8bcbe2d5d7
27 lines
764 B
YAML
27 lines
764 B
YAML
publishers:
|
|
- trigger-parameterized-builds:
|
|
- project:
|
|
- other_job
|
|
- foo
|
|
- bar
|
|
predefined-parameters: |
|
|
foo=bar
|
|
bar=foo
|
|
- project: other_job1, other_job2
|
|
predefined-parameters: BUILD_NUM=${BUILD_NUMBER}
|
|
git-revision: true
|
|
property-file: version.prop
|
|
fail-on-missing: true
|
|
- project: yet_another_job
|
|
predefined-parameters: foo=bar
|
|
git-revision:
|
|
combine-queued-commits: true
|
|
restrict-matrix-project: label=="x86"
|
|
- project: yet_another_job_2
|
|
node-label-name: foo
|
|
- project: yet_another_job_3
|
|
node-label: node-label-foo || node-label-bar
|
|
- project: 'test-project-same-node'
|
|
node-parameters: true
|
|
current-parameters: true
|