Update rebuild plugin to use convert xml
- Rename test file to be more descriptive - Add minimal test file - Add plugin="rebuild" attribute - Add plugin desciption to doc Change-Id: I466d8fed4c4167b9693ae3bb369611ef4b63e318 Signed-off-by: Kien Ha <kienha9922@gmail.com>
This commit is contained in:
parent
54f4e51b2c
commit
956f0ce4f8
@ -748,27 +748,36 @@ def slack(registry, xml_parent, data):
|
|||||||
|
|
||||||
def rebuild(registry, xml_parent, data):
|
def rebuild(registry, xml_parent, data):
|
||||||
"""yaml: rebuild
|
"""yaml: rebuild
|
||||||
Requires the Jenkins :jenkins-wiki:`Rebuild Plugin
|
This plug-in allows the user to rebuild a parameterized build without
|
||||||
<Rebuild+Plugin>`.
|
entering the parameters again.It will also allow the user to edit the
|
||||||
|
parameters before rebuilding.
|
||||||
|
Requires the Jenkins :jenkins-wiki:`Rebuild Plugin <Rebuild+Plugin>`.
|
||||||
|
|
||||||
:arg bool auto-rebuild: Rebuild without asking for parameters
|
:arg bool auto-rebuild: Rebuild without asking for parameters
|
||||||
(default false)
|
(default false)
|
||||||
:arg bool rebuild-disabled: Disable rebuilding for this job
|
:arg bool rebuild-disabled: Disable rebuilding for this job
|
||||||
(default false)
|
(default false)
|
||||||
|
|
||||||
Example:
|
Minimal Example:
|
||||||
|
|
||||||
.. literalinclude::
|
.. literalinclude:: /../../tests/properties/fixtures/rebuild-minimal.yaml
|
||||||
/../../tests/properties/fixtures/rebuild.yaml
|
:language: yaml
|
||||||
|
|
||||||
|
Full Example:
|
||||||
|
|
||||||
|
.. literalinclude:: /../../tests/properties/fixtures/rebuild-full.yaml
|
||||||
:language: yaml
|
:language: yaml
|
||||||
"""
|
"""
|
||||||
sub_element = XML.SubElement(xml_parent,
|
sub_element = XML.SubElement(xml_parent,
|
||||||
'com.sonyericsson.rebuild.RebuildSettings')
|
'com.sonyericsson.rebuild.RebuildSettings')
|
||||||
|
sub_element.set('plugin', 'rebuild')
|
||||||
|
|
||||||
XML.SubElement(sub_element, 'autoRebuild').text = str(
|
mapping = [
|
||||||
data.get('auto-rebuild', False)).lower()
|
('auto-rebuild', 'autoRebuild', False),
|
||||||
XML.SubElement(sub_element, 'rebuildDisabled').text = str(
|
('rebuild-disabled', 'rebuildDisabled', False),
|
||||||
data.get('rebuild-disabled', False)).lower()
|
]
|
||||||
|
helpers.convert_mapping_to_xml(
|
||||||
|
sub_element, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def build_discarder(registry, xml_parent, data):
|
def build_discarder(registry, xml_parent, data):
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<project>
|
<project>
|
||||||
<properties>
|
<properties>
|
||||||
<com.sonyericsson.rebuild.RebuildSettings>
|
<com.sonyericsson.rebuild.RebuildSettings plugin="rebuild">
|
||||||
<autoRebuild>true</autoRebuild>
|
<autoRebuild>true</autoRebuild>
|
||||||
<rebuildDisabled>true</rebuildDisabled>
|
<rebuildDisabled>true</rebuildDisabled>
|
||||||
</com.sonyericsson.rebuild.RebuildSettings>
|
</com.sonyericsson.rebuild.RebuildSettings>
|
9
tests/properties/fixtures/rebuild-minimal.xml
Normal file
9
tests/properties/fixtures/rebuild-minimal.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<project>
|
||||||
|
<properties>
|
||||||
|
<com.sonyericsson.rebuild.RebuildSettings plugin="rebuild">
|
||||||
|
<autoRebuild>false</autoRebuild>
|
||||||
|
<rebuildDisabled>false</rebuildDisabled>
|
||||||
|
</com.sonyericsson.rebuild.RebuildSettings>
|
||||||
|
</properties>
|
||||||
|
</project>
|
2
tests/properties/fixtures/rebuild-minimal.yaml
Normal file
2
tests/properties/fixtures/rebuild-minimal.yaml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
properties:
|
||||||
|
- rebuild
|
Loading…
x
Reference in New Issue
Block a user