Adding support for Hidden parameter plugin

Change-Id: I853b12bc0b28211133cf9bb990e910df6541f4f7
This commit is contained in:
Joost van der Griendt 2016-08-13 23:41:21 +02:00
parent 5906a2adcc
commit d3413105c3
3 changed files with 40 additions and 0 deletions

View File

@ -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

View 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>

View File

@ -0,0 +1,5 @@
parameters:
- hidden:
name: FOO
default: bar
description: A parameter named FOO, defaults to 'bar'