Add support for Sonar wrapper
Change-Id: I47f4d2909231fd310e221cbd0f635943b7fbd76b Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
This commit is contained in:
parent
23cbeda2e9
commit
d4edd22336
@ -1333,6 +1333,34 @@ def sauce_ondemand(registry, xml_parent, data):
|
|||||||
XML.SubElement(sauce, 'options').text = options
|
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):
|
def pathignore(registry, xml_parent, data):
|
||||||
"""yaml: pathignore
|
"""yaml: pathignore
|
||||||
This plugin allows SCM-triggered jobs to ignore
|
This plugin allows SCM-triggered jobs to ignore
|
||||||
|
8
tests/wrappers/fixtures/sonar-full.xml
Normal file
8
tests/wrappers/fixtures/sonar-full.xml
Normal 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>
|
3
tests/wrappers/fixtures/sonar-full.yaml
Normal file
3
tests/wrappers/fixtures/sonar-full.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
wrappers:
|
||||||
|
- sonar:
|
||||||
|
install-name: test-sonar-installation
|
6
tests/wrappers/fixtures/sonar-minimal.xml
Normal file
6
tests/wrappers/fixtures/sonar-minimal.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<project>
|
||||||
|
<buildWrappers>
|
||||||
|
<hudson.plugins.sonar.SonarBuildWrapper plugin="sonar"/>
|
||||||
|
</buildWrappers>
|
||||||
|
</project>
|
2
tests/wrappers/fixtures/sonar-minimal.yaml
Normal file
2
tests/wrappers/fixtures/sonar-minimal.yaml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
wrappers:
|
||||||
|
- sonar
|
Loading…
Reference in New Issue
Block a user