Adding Top-Level Maven Targets

Adding ability to use top-level maven targets within your build.
This is a change to the builders file and setup.py to add the new
functionality.

Change-Id: I7ae24b82d0b0ba4e81eda67045131733ced1dc46
Reviewed-on: https://review.openstack.org/25413
Reviewed-by: Khai Do <zaro0508@gmail.com>
Reviewed-by: Arnaud Fabre <fabre.arnaud@gmail.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins
This commit is contained in:
Will Soula 2013-03-26 11:51:09 -05:00 committed by Jenkins
parent 97f9c072e8
commit c632944a97
2 changed files with 28 additions and 0 deletions

View File

@ -484,6 +484,33 @@ def batch(parser, xml_parent, data):
XML.SubElement(batch, 'command').text = data
def maven_target(parser, xml_parent, data):
"""yaml: maven-target
Execute top-level Maven targets
:arg str goals: Goals to execute
:arg str properties: Properties for maven, can have multiples
Example::
builders:
- maven-target:
goals: clean
properties:
- foo=bar
- bar=foo
"""
maven = XML.SubElement(xml_parent, 'hudson.tasks.Maven')
XML.SubElement(maven, 'targets').text = data['goals']
prop_string = '\n'.join(data.get('properties', []))
XML.SubElement(maven, 'properties').text = prop_string
XML.SubElement(maven, 'usePrivateRepository').text = 'false'
XML.SubElement(maven, 'settings', {
'class': 'jenkins.mvn.DefaultSettingsProvider'})
XML.SubElement(maven, 'globalSettings', {
'class': 'jenkins.mvn.DefaultGlobalSettingsProvider'})
class Builders(jenkins_jobs.modules.base.Base):
sequence = 60

View File

@ -64,6 +64,7 @@ setuptools.setup(
'copyartifact=jenkins_jobs.modules.builders:copyartifact',
'gradle=jenkins_jobs.modules.builders:gradle',
'batch=jenkins_jobs.modules.builders:batch',
'maven-target=jenkins_jobs.modules.builders:maven_target',
],
'jenkins_jobs.reporters': [
'email=jenkins_jobs.modules.reporters:email',