Add support for Sonar wrapper

Change-Id: I47f4d2909231fd310e221cbd0f635943b7fbd76b
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
This commit is contained in:
Thanh Ha 2016-09-12 21:30:00 -04:00
parent 23cbeda2e9
commit d4edd22336
No known key found for this signature in database
GPG Key ID: B0CB27E00DA095AA
5 changed files with 47 additions and 0 deletions

View File

@ -1333,6 +1333,34 @@ def sauce_ondemand(registry, xml_parent, data):
XML.SubElement(sauce, 'options').text = options
def sonar(registry, xml_parent, data):
"""yaml: sonar
Wrapper for SonarQube Plugin
Requires :jenkins-wiki:`SonarQube plugin <SonarQube+plugin>`
:arg str install-name: Release goals and options (default '')
Minimal Example:
.. literalinclude:: /../../tests/wrappers/fixtures/sonar-minimal.yaml
:language: yaml
Full Example:
.. literalinclude:: /../../tests/wrappers/fixtures/sonar-full.yaml
:language: yaml
"""
sonar = XML.SubElement(
xml_parent, 'hudson.plugins.sonar.SonarBuildWrapper')
sonar.set('plugin', 'sonar')
if data.get('install-name'):
mapping = [
('install-name', 'installationName', ''),
]
convert_mapping_to_xml(sonar, data, mapping, fail_required=True)
def pathignore(registry, xml_parent, data):
"""yaml: pathignore
This plugin allows SCM-triggered jobs to ignore

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<buildWrappers>
<hudson.plugins.sonar.SonarBuildWrapper plugin="sonar">
<installationName>test-sonar-installation</installationName>
</hudson.plugins.sonar.SonarBuildWrapper>
</buildWrappers>
</project>

View File

@ -0,0 +1,3 @@
wrappers:
- sonar:
install-name: test-sonar-installation

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<buildWrappers>
<hudson.plugins.sonar.SonarBuildWrapper plugin="sonar"/>
</buildWrappers>
</project>

View File

@ -0,0 +1,2 @@
wrappers:
- sonar