Adding support for Hidden parameter plugin
Change-Id: I853b12bc0b28211133cf9bb990e910df6541f4f7
This commit is contained in:
parent
5906a2adcc
commit
d3413105c3
@ -760,6 +760,27 @@ def maven_metadata_param(parser, xml_parent, data):
|
||||
XML.SubElement(pdef, 'password').text = data.get('repository-password', '')
|
||||
|
||||
|
||||
def hidden_param(parser, xml_parent, data):
|
||||
"""yaml: hidden
|
||||
Allows you to use parameters hidden from the build with parameter page.
|
||||
Requires the Jenkins :jenkins-wiki:`Hidden Parameter Plugin
|
||||
<Hidden+Parameter+Plugin>`.
|
||||
|
||||
: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)
|
||||
|
||||
Example:
|
||||
|
||||
.. literalinclude::
|
||||
/../../tests/parameters/fixtures/hidden-param001.yaml
|
||||
:language: yaml
|
||||
|
||||
"""
|
||||
base_param(parser, xml_parent, data, True,
|
||||
'com.wangyin.parameter.WHideParameterDefinition')
|
||||
|
||||
|
||||
class Parameters(jenkins_jobs.modules.base.Base):
|
||||
sequence = 21
|
||||
|
||||
|
14
tests/parameters/fixtures/hidden-param001.xml
Normal file
14
tests/parameters/fixtures/hidden-param001.xml
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<properties>
|
||||
<hudson.model.ParametersDefinitionProperty>
|
||||
<parameterDefinitions>
|
||||
<com.wangyin.parameter.WHideParameterDefinition>
|
||||
<name>FOO</name>
|
||||
<description>A parameter named FOO, defaults to 'bar'</description>
|
||||
<defaultValue>bar</defaultValue>
|
||||
</com.wangyin.parameter.WHideParameterDefinition>
|
||||
</parameterDefinitions>
|
||||
</hudson.model.ParametersDefinitionProperty>
|
||||
</properties>
|
||||
</project>
|
5
tests/parameters/fixtures/hidden-param001.yaml
Normal file
5
tests/parameters/fixtures/hidden-param001.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
parameters:
|
||||
- hidden:
|
||||
name: FOO
|
||||
default: bar
|
||||
description: A parameter named FOO, defaults to 'bar'
|
Loading…
x
Reference in New Issue
Block a user