diff --git a/jenkins_jobs/modules/parameters.py b/jenkins_jobs/modules/parameters.py index 6aed83925..67a8c3f0a 100644 --- a/jenkins_jobs/modules/parameters.py +++ b/jenkins_jobs/modules/parameters.py @@ -190,6 +190,8 @@ def label_param(registry, xml_parent, data): :arg str name: the name of the parameter :arg str default: the default value of the parameter (optional) :arg str description: a description of the parameter (optional) + :arg bool all-nodes: to run job on all nodes matching label + in parallel (default: true) :arg str matching-label: to run all nodes matching label 'success', 'unstable' or 'allCases' (optional) :arg str node-eligibility: all nodes, ignore temporary nodes or @@ -206,10 +208,9 @@ def label_param(registry, xml_parent, data): 'org.jvnet.jenkins.plugins.nodelabelparameter.' 'LabelParameterDefinition') - XML.SubElement(pdef, 'allNodesMatchingLabel').text = "true" - valid_types = ['allCases', 'success', 'unstable'] mapping = [ + ('all-nodes', 'allNodesMatchingLabel', True), ('matching-label', 'triggerIfResult', 'allCases', valid_types), ] helpers.convert_mapping_to_xml(pdef, data, mapping, fail_required=True) diff --git a/tests/parameters/fixtures/node-label005.xml b/tests/parameters/fixtures/node-label005.xml new file mode 100644 index 000000000..d1094633b --- /dev/null +++ b/tests/parameters/fixtures/node-label005.xml @@ -0,0 +1,17 @@ + + + + + + + EXAMPLE LABEL 4 + EXAMPLE LABEL DESCRIPTION 4 + + false + allCases + + + + + + diff --git a/tests/parameters/fixtures/node-label005.yaml b/tests/parameters/fixtures/node-label005.yaml new file mode 100644 index 000000000..1b425375d --- /dev/null +++ b/tests/parameters/fixtures/node-label005.yaml @@ -0,0 +1,5 @@ +parameters: + - label: + name: EXAMPLE LABEL 4 + description: "EXAMPLE LABEL DESCRIPTION 4" + all-nodes: false