Merge "Support site monitor publisher"

This commit is contained in:
Jenkins 2014-02-02 19:52:21 +00:00 committed by Gerrit Code Review
commit de497e7548
4 changed files with 45 additions and 0 deletions

View File

@ -3113,6 +3113,30 @@ def description_setter(parser, xml_parent, data):
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):
sequence = 70

View File

@ -154,6 +154,7 @@ setuptools.setup(
'junit=jenkins_jobs.modules.publishers:junit',
'logparser=jenkins_jobs.modules.publishers:logparser',
'maven-deploy=jenkins_jobs.modules.publishers:maven_deploy',
'sitemonitor=jenkins_jobs.modules.publishers:sitemonitor',
'performance=jenkins_jobs.modules.publishers:performance',
'pipeline=jenkins_jobs.modules.publishers:pipeline',
'plot=jenkins_jobs.modules.publishers:plot',

View 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>

View File

@ -0,0 +1,5 @@
publishers:
- sitemonitor:
sites:
- url: http://foo.example.com
- url: http://bar.example.com:8080/