Support site monitor publisher
This publisher allows to check an URL after the build steps. It requires the sitemonitor plugin from https://wiki.jenkins-ci.org/display/JENKINS/SiteMonitor+Plugin Change-Id: I83026e4db9bd7975a34b7d8e015a4a73c3b09ae8
This commit is contained in:
parent
bbfdeff09a
commit
97cdaa8114
@ -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
|
||||
|
||||
|
1
setup.py
1
setup.py
@ -152,6 +152,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',
|
||||
|
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