Merge "Support site monitor publisher"
This commit is contained in:
commit
de497e7548
@ -3113,6 +3113,30 @@ def description_setter(parser, xml_parent, data):
|
|||||||
XML.SubElement(descriptionsetter, 'setForMatrix').text = for_matrix
|
XML.SubElement(descriptionsetter, 'setForMatrix').text = for_matrix
|
||||||
|
|
||||||
|
|
||||||
|
def sitemonitor(parser, xml_parent, data):
|
||||||
|
"""yaml: sitemonitor
|
||||||
|
This plugin checks the availability of an url.
|
||||||
|
|
||||||
|
It requires the `sitemonitor plugin.
|
||||||
|
<https://wiki.jenkins-ci.org/display/JENKINS/SiteMonitor+Plugin>`_
|
||||||
|
|
||||||
|
:arg list sites: List of URLs to check
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
.. literalinclude:: /../../tests/publishers/fixtures/sitemonitor001.yaml
|
||||||
|
|
||||||
|
"""
|
||||||
|
mon = XML.SubElement(xml_parent,
|
||||||
|
'hudson.plugins.sitemonitor.SiteMonitorRecorder')
|
||||||
|
if data.get('sites'):
|
||||||
|
sites = XML.SubElement(mon, 'mSites')
|
||||||
|
for siteurl in data.get('sites'):
|
||||||
|
site = XML.SubElement(sites,
|
||||||
|
'hudson.plugins.sitemonitor.model.Site')
|
||||||
|
XML.SubElement(site, 'mUrl').text = siteurl['url']
|
||||||
|
|
||||||
|
|
||||||
class Publishers(jenkins_jobs.modules.base.Base):
|
class Publishers(jenkins_jobs.modules.base.Base):
|
||||||
sequence = 70
|
sequence = 70
|
||||||
|
|
||||||
|
1
setup.py
1
setup.py
@ -154,6 +154,7 @@ setuptools.setup(
|
|||||||
'junit=jenkins_jobs.modules.publishers:junit',
|
'junit=jenkins_jobs.modules.publishers:junit',
|
||||||
'logparser=jenkins_jobs.modules.publishers:logparser',
|
'logparser=jenkins_jobs.modules.publishers:logparser',
|
||||||
'maven-deploy=jenkins_jobs.modules.publishers:maven_deploy',
|
'maven-deploy=jenkins_jobs.modules.publishers:maven_deploy',
|
||||||
|
'sitemonitor=jenkins_jobs.modules.publishers:sitemonitor',
|
||||||
'performance=jenkins_jobs.modules.publishers:performance',
|
'performance=jenkins_jobs.modules.publishers:performance',
|
||||||
'pipeline=jenkins_jobs.modules.publishers:pipeline',
|
'pipeline=jenkins_jobs.modules.publishers:pipeline',
|
||||||
'plot=jenkins_jobs.modules.publishers:plot',
|
'plot=jenkins_jobs.modules.publishers:plot',
|
||||||
|
15
tests/publishers/fixtures/sitemonitor001.xml
Normal file
15
tests/publishers/fixtures/sitemonitor001.xml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<project>
|
||||||
|
<publishers>
|
||||||
|
<hudson.plugins.sitemonitor.SiteMonitorRecorder>
|
||||||
|
<mSites>
|
||||||
|
<hudson.plugins.sitemonitor.model.Site>
|
||||||
|
<mUrl>http://foo.example.com</mUrl>
|
||||||
|
</hudson.plugins.sitemonitor.model.Site>
|
||||||
|
<hudson.plugins.sitemonitor.model.Site>
|
||||||
|
<mUrl>http://bar.example.com:8080/</mUrl>
|
||||||
|
</hudson.plugins.sitemonitor.model.Site>
|
||||||
|
</mSites>
|
||||||
|
</hudson.plugins.sitemonitor.SiteMonitorRecorder>
|
||||||
|
</publishers>
|
||||||
|
</project>
|
5
tests/publishers/fixtures/sitemonitor001.yaml
Normal file
5
tests/publishers/fixtures/sitemonitor001.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
publishers:
|
||||||
|
- sitemonitor:
|
||||||
|
sites:
|
||||||
|
- url: http://foo.example.com
|
||||||
|
- url: http://bar.example.com:8080/
|
Loading…
Reference in New Issue
Block a user