Merge "Enable groovy-script includes for extended_choice_param"

This commit is contained in:
Zuul 2018-02-27 17:48:01 +00:00 committed by Gerrit Code Review
commit 673523e2c3
5 changed files with 46 additions and 1 deletions

View File

@ -394,7 +394,11 @@ def extended_choice_param(registry, xml_parent, data):
:arg str description-property-key: key for the value description
property file (optional, default '')
:arg str multi-select-delimiter: value between selections when the
parameter is a multi-select (optiona, default ',')
parameter is a multi-select (optional, default ',')
:arg str groovy-script: the groovy script contents (optional, default ',')
:arg str classpath: the classpath for the groovy script
(optional, default ',')
Minimal Example:
@ -437,6 +441,8 @@ def extended_choice_param(registry, xml_parent, data):
('default-property-key', 'defaultPropertyKey', ''),
('description-property-file', 'descriptionPropertyFile', ''),
('description-property-key', 'descriptionPropertyKey', ''),
('groovy-script', 'groovyScript', ''),
('classpath', 'groovyClasspath', ''),
]
convert_mapping_to_xml(pdef, data, mapping, fail_required=True)

View File

@ -19,6 +19,8 @@
<defaultPropertyKey>fookey</defaultPropertyKey>
<descriptionPropertyFile/>
<descriptionPropertyKey/>
<groovyScript/>
<groovyClasspath/>
</com.cwctravel.hudson.plugins.extended__choice__parameter.ExtendedChoiceParameterDefinition>
</parameterDefinitions>
</hudson.model.ParametersDefinitionProperty>

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<properties>
<hudson.model.ParametersDefinitionProperty>
<parameterDefinitions>
<com.cwctravel.hudson.plugins.extended__choice__parameter.ExtendedChoiceParameterDefinition>
<name>OPTIONS</name>
<description>Available options</description>
<value/>
<visibleItemCount>5</visibleItemCount>
<multiSelectDelimiter>,</multiSelectDelimiter>
<quoteValue>false</quoteValue>
<defaultValue/>
<descriptionPropertyValue/>
<type>PT_CHECKBOX</type>
<propertyFile/>
<propertyKey/>
<defaultPropertyFile/>
<defaultPropertyKey/>
<descriptionPropertyFile/>
<descriptionPropertyKey/>
<groovyScript>return 'value1, value2, value3'</groovyScript>
<groovyClasspath/>
</com.cwctravel.hudson.plugins.extended__choice__parameter.ExtendedChoiceParameterDefinition>
</parameterDefinitions>
</hudson.model.ParametersDefinitionProperty>
</properties>
</project>

View File

@ -0,0 +1,7 @@
parameters:
- extended-choice:
name: OPTIONS
description: "Available options"
type: 'PT_CHECKBOX'
groovy-script: "return 'value1, value2, value3'"
classpath: ''

View File

@ -19,6 +19,8 @@
<defaultPropertyKey/>
<descriptionPropertyFile/>
<descriptionPropertyKey/>
<groovyScript/>
<groovyClasspath/>
</com.cwctravel.hudson.plugins.extended__choice__parameter.ExtendedChoiceParameterDefinition>
</parameterDefinitions>
</hudson.model.ParametersDefinitionProperty>