Merge "Create one parameters wrapper tag for all release params"

This commit is contained in:
Jenkins 2014-10-30 14:44:25 +00:00 committed by Gerrit Code Review
commit e1e10e266e
3 changed files with 54 additions and 19 deletions

View File

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

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

View 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