Adding support for Beaker Builder Plugin
https://wiki.jenkins-ci.org/display/JENKINS/Beaker+Builder+Plugin Change-Id: I66d1a34b1fb1f39a146f051178bc52cbdec8cc6f
This commit is contained in:
parent
e4f77fe06c
commit
3931a2b9b9
@ -1924,3 +1924,42 @@ def sonatype_clm(parser, xml_parent, data):
|
||||
data.get('module-excludes', '')).lower()
|
||||
XML.SubElement(path_config, 'scanProperties').text = str(
|
||||
data.get('advanced-options', '')).lower()
|
||||
|
||||
|
||||
def beaker(parser, xml_parent, data):
|
||||
"""yaml: beaker
|
||||
Execute a beaker build step. Requires the Jenkins :jenkins-wiki:`Beaker
|
||||
Builder Plugin <Beaker+Builder+Plugin>`.
|
||||
|
||||
:arg str content: Run job from string
|
||||
(Alternative: you can choose a path instead)
|
||||
:arg str path: Run job from file
|
||||
(Alternative: you can choose a content instead)
|
||||
:arg bool download-logs: Download Beaker log files (default false)
|
||||
|
||||
Example:
|
||||
|
||||
.. literalinclude:: ../../tests/builders/fixtures/beaker-path.yaml
|
||||
:language: yaml
|
||||
|
||||
.. literalinclude:: ../../tests/builders/fixtures/beaker-content.yaml
|
||||
:language: yaml
|
||||
"""
|
||||
beaker = XML.SubElement(xml_parent, 'org.jenkinsci.plugins.beakerbuilder.'
|
||||
'BeakerBuilder')
|
||||
jobSource = XML.SubElement(beaker, 'jobSource')
|
||||
if 'content' in data and 'path' in data:
|
||||
raise JenkinsJobsException("Use just one of 'content' or 'path'")
|
||||
elif 'content' in data:
|
||||
jobSourceClass = "org.jenkinsci.plugins.beakerbuilder.StringJobSource"
|
||||
jobSource.set('class', jobSourceClass)
|
||||
XML.SubElement(jobSource, 'jobContent').text = data['content']
|
||||
elif 'path' in data:
|
||||
jobSourceClass = "org.jenkinsci.plugins.beakerbuilder.FileJobSource"
|
||||
jobSource.set('class', jobSourceClass)
|
||||
XML.SubElement(jobSource, 'jobPath').text = data['path']
|
||||
else:
|
||||
raise JenkinsJobsException("Use one of 'content' or 'path'")
|
||||
|
||||
XML.SubElement(beaker, 'downloadFiles').text = str(data.get(
|
||||
'download-logs', False)).lower()
|
||||
|
@ -47,6 +47,7 @@ jenkins_jobs.builders =
|
||||
ant=jenkins_jobs.modules.builders:ant
|
||||
artifact-resolver=jenkins_jobs.modules.builders:artifact_resolver
|
||||
batch=jenkins_jobs.modules.builders:batch
|
||||
beaker=jenkins_jobs.modules.builders:beaker
|
||||
builders-from=jenkins_jobs.modules.builders:builders_from
|
||||
change-assembly-version=jenkins_jobs.modules.builders:change_assembly_version
|
||||
cmake=jenkins_jobs.modules.builders:cmake
|
||||
|
16
tests/builders/fixtures/beaker-content.xml
Normal file
16
tests/builders/fixtures/beaker-content.xml
Normal file
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<builders>
|
||||
<org.jenkinsci.plugins.beakerbuilder.BeakerBuilder>
|
||||
<jobSource class="org.jenkinsci.plugins.beakerbuilder.StringJobSource">
|
||||
<jobContent><job group='product-QA'>
|
||||
<whiteboard>
|
||||
Apache 2.2 test
|
||||
</whiteboard>
|
||||
</job>
|
||||
</jobContent>
|
||||
</jobSource>
|
||||
<downloadFiles>false</downloadFiles>
|
||||
</org.jenkinsci.plugins.beakerbuilder.BeakerBuilder>
|
||||
</builders>
|
||||
</project>
|
8
tests/builders/fixtures/beaker-content.yaml
Normal file
8
tests/builders/fixtures/beaker-content.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
builders:
|
||||
- beaker:
|
||||
content: |
|
||||
<job group='product-QA'>
|
||||
<whiteboard>
|
||||
Apache 2.2 test
|
||||
</whiteboard>
|
||||
</job>
|
11
tests/builders/fixtures/beaker-path.xml
Normal file
11
tests/builders/fixtures/beaker-path.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<builders>
|
||||
<org.jenkinsci.plugins.beakerbuilder.BeakerBuilder>
|
||||
<jobSource class="org.jenkinsci.plugins.beakerbuilder.FileJobSource">
|
||||
<jobPath>test.xml</jobPath>
|
||||
</jobSource>
|
||||
<downloadFiles>true</downloadFiles>
|
||||
</org.jenkinsci.plugins.beakerbuilder.BeakerBuilder>
|
||||
</builders>
|
||||
</project>
|
4
tests/builders/fixtures/beaker-path.yaml
Normal file
4
tests/builders/fixtures/beaker-path.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
builders:
|
||||
- beaker:
|
||||
path: 'test.xml'
|
||||
download-logs: true
|
Loading…
Reference in New Issue
Block a user