Merge "Create one parameters wrapper tag for all release params"
This commit is contained in:
commit
e1e10e266e
@ -736,27 +736,17 @@ def release(parser, xml_parent, data):
|
||||
|
||||
:arg bool keep-forever: Keep build forever (default true)
|
||||
:arg bool override-build-parameters: Enable build-parameter override
|
||||
:arg string version-template: Release version template
|
||||
(default false)
|
||||
:arg string version-template: Release version template (default '')
|
||||
:arg list parameters: Release parameters (see the :ref:`Parameters` module)
|
||||
:arg list pre-build: Pre-build steps (see the :ref:`Builders` module)
|
||||
:arg list post-build: Post-build steps (see :ref:`Builders`)
|
||||
:arg list post-success: Post successful-build steps (see :ref:`Builders`)
|
||||
:arg list post-failed: Post failed-build steps (see :ref:`Builders`)
|
||||
|
||||
Example::
|
||||
Example:
|
||||
|
||||
wrappers:
|
||||
- release:
|
||||
keep-forever: false
|
||||
parameters:
|
||||
- string:
|
||||
name: RELEASE_BRANCH
|
||||
default: ''
|
||||
description: Git branch to release from.
|
||||
post-success:
|
||||
- shell: |
|
||||
#!/bin/bash
|
||||
copy_build_artefacts.sh
|
||||
.. literalinclude:: /../../tests/wrappers/fixtures/release001.yaml
|
||||
|
||||
"""
|
||||
relwrap = XML.SubElement(xml_parent,
|
||||
@ -771,11 +761,11 @@ def release(parser, xml_parent, data):
|
||||
data.get('override-build-parameters', False)).lower()
|
||||
XML.SubElement(relwrap, 'releaseVersionTemplate').text = data.get(
|
||||
'version-template', '')
|
||||
for param in data.get('parameters', []):
|
||||
parser.registry.dispatch('parameter', parser,
|
||||
XML.SubElement(relwrap,
|
||||
'parameterDefinitions'),
|
||||
param)
|
||||
parameters = data.get('parameters', [])
|
||||
if parameters:
|
||||
pdef = XML.SubElement(relwrap, 'parameterDefinitions')
|
||||
for param in parameters:
|
||||
parser.registry.dispatch('parameter', parser, pdef, param)
|
||||
|
||||
builder_steps = {
|
||||
'pre-build': 'preBuildSteps',
|
||||
|
29
tests/wrappers/fixtures/release001.xml
Normal file
29
tests/wrappers/fixtures/release001.xml
Normal file
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<buildWrappers>
|
||||
<hudson.plugins.release.ReleaseWrapper>
|
||||
<doNotKeepLog>true</doNotKeepLog>
|
||||
<overrideBuildParameters>false</overrideBuildParameters>
|
||||
<releaseVersionTemplate/>
|
||||
<parameterDefinitions>
|
||||
<hudson.model.StringParameterDefinition>
|
||||
<name>RELEASE_BRANCH</name>
|
||||
<description>Git branch to release from.</description>
|
||||
<defaultValue/>
|
||||
</hudson.model.StringParameterDefinition>
|
||||
<hudson.model.BooleanParameterDefinition>
|
||||
<name>FOO</name>
|
||||
<description>A parameter named FOO, defaults to 'false'.</description>
|
||||
<defaultValue>false</defaultValue>
|
||||
</hudson.model.BooleanParameterDefinition>
|
||||
</parameterDefinitions>
|
||||
<postSuccessfulBuildSteps>
|
||||
<hudson.tasks.Shell>
|
||||
<command>#!/bin/bash
|
||||
copy_build_artefacts.sh
|
||||
</command>
|
||||
</hudson.tasks.Shell>
|
||||
</postSuccessfulBuildSteps>
|
||||
</hudson.plugins.release.ReleaseWrapper>
|
||||
</buildWrappers>
|
||||
</project>
|
16
tests/wrappers/fixtures/release001.yaml
Normal file
16
tests/wrappers/fixtures/release001.yaml
Normal file
@ -0,0 +1,16 @@
|
||||
wrappers:
|
||||
- release:
|
||||
keep-forever: false
|
||||
parameters:
|
||||
- string:
|
||||
name: RELEASE_BRANCH
|
||||
default: ''
|
||||
description: Git branch to release from.
|
||||
- bool:
|
||||
name: FOO
|
||||
default: false
|
||||
description: "A parameter named FOO, defaults to 'false'."
|
||||
post-success:
|
||||
- shell: |
|
||||
#!/bin/bash
|
||||
copy_build_artefacts.sh
|
Loading…
x
Reference in New Issue
Block a user