diff --git a/jenkins_jobs/modules/builders.py b/jenkins_jobs/modules/builders.py index d860e2c3a..2de5110cd 100644 --- a/jenkins_jobs/modules/builders.py +++ b/jenkins_jobs/modules/builders.py @@ -1564,6 +1564,8 @@ def multijob(parser, xml_parent, data): * **node-label** (`str`) -- Define a label of 'Restrict where this project can be run' on the fly. Requires NodeLabel Parameter Plugin (optional) + * **node-parameters** (`bool`) -- Use the same Node for + the triggered builds that was used for this build. (optional) * **git-revision** (`bool`) -- Pass current git-revision to the other job (default false) * **property-file** (`str`) -- Pass properties from file @@ -1624,6 +1626,11 @@ def multijob(parser, xml_parent, data): XML.SubElement(node, 'name').text = nodeLabelName XML.SubElement(node, 'nodeLabel').text = nodeLabel + # Node parameter + if project.get('node-parameters', False): + XML.SubElement(configs, 'hudson.plugins.parameterizedtrigger.' + 'NodeParameters') + # Git Revision if project.get('git-revision', False): param = XML.SubElement(configs, diff --git a/tests/builders/fixtures/multibuild.xml b/tests/builders/fixtures/multibuild.xml index 6e6b34114..194435073 100644 --- a/tests/builders/fixtures/multibuild.xml +++ b/tests/builders/fixtures/multibuild.xml @@ -40,6 +40,7 @@ PhaseTwoJobA true + foo=bar diff --git a/tests/builders/fixtures/multibuild.yaml b/tests/builders/fixtures/multibuild.yaml index 175b40b37..37bd9fe81 100644 --- a/tests/builders/fixtures/multibuild.yaml +++ b/tests/builders/fixtures/multibuild.yaml @@ -19,6 +19,7 @@ builders: - name: PhaseTwoJobA current-parameters: true predefined-parameters: foo=bar + node-parameters: true - name: PhaseTwoJobB current-parameters: false kill-phase-on: UNSTABLE