Add 'Job Log Logger' wrapper
The Job Log Logger plugin writes the Jenkins job log to the underlying Jenkins log system in addition to the normal build log. Change-Id: I17b73ade974edf3d7a2d1e08c4e4c584dbe32c51
This commit is contained in:
parent
b059ac4ff0
commit
2bb16b594d
@ -1288,6 +1288,27 @@ def xvnc(parser, xml_parent, data):
|
|||||||
data.get('xauthority', True)).lower()
|
data.get('xauthority', True)).lower()
|
||||||
|
|
||||||
|
|
||||||
|
def job_log_logger(parser, xml_parent, data):
|
||||||
|
"""yaml: job-log-logger
|
||||||
|
Enable writing the job log to the underlying logging system.
|
||||||
|
Requires the Jenkins :jenkins-wiki:`Job Log Logger plugin
|
||||||
|
<Job+Log+Logger+Plugin>`.
|
||||||
|
|
||||||
|
:arg bool suppress-empty: Suppress empty log messages
|
||||||
|
(default: true)
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
.. literalinclude:: /../../tests/wrappers/fixtures/job-log-logger001.yaml
|
||||||
|
|
||||||
|
"""
|
||||||
|
top = XML.SubElement(xml_parent,
|
||||||
|
'org.jenkins.ci.plugins.jobloglogger.'
|
||||||
|
'JobLogLoggerBuildWrapper')
|
||||||
|
XML.SubElement(top, 'suppressEmpty').text = str(
|
||||||
|
data.get('suppress-empty', True)).lower()
|
||||||
|
|
||||||
|
|
||||||
class Wrappers(jenkins_jobs.modules.base.Base):
|
class Wrappers(jenkins_jobs.modules.base.Base):
|
||||||
sequence = 80
|
sequence = 80
|
||||||
|
|
||||||
|
@ -221,6 +221,7 @@ jenkins_jobs.wrappers =
|
|||||||
inject-passwords=jenkins_jobs.modules.wrappers:inject_passwords
|
inject-passwords=jenkins_jobs.modules.wrappers:inject_passwords
|
||||||
inject=jenkins_jobs.modules.wrappers:inject
|
inject=jenkins_jobs.modules.wrappers:inject
|
||||||
jclouds=jenkins_jobs.modules.wrappers:jclouds
|
jclouds=jenkins_jobs.modules.wrappers:jclouds
|
||||||
|
job-log-logger=jenkins_jobs.modules.wrappers:job_log_logger
|
||||||
locks=jenkins_jobs.modules.wrappers:locks
|
locks=jenkins_jobs.modules.wrappers:locks
|
||||||
logfilesize=jenkins_jobs.modules.wrappers:logfilesize
|
logfilesize=jenkins_jobs.modules.wrappers:logfilesize
|
||||||
logstash=jenkins_jobs.modules.wrappers:logstash
|
logstash=jenkins_jobs.modules.wrappers:logstash
|
||||||
|
8
tests/wrappers/fixtures/job-log-logger001.xml
Normal file
8
tests/wrappers/fixtures/job-log-logger001.xml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<project>
|
||||||
|
<buildWrappers>
|
||||||
|
<org.jenkins.ci.plugins.jobloglogger.JobLogLoggerBuildWrapper>
|
||||||
|
<suppressEmpty>false</suppressEmpty>
|
||||||
|
</org.jenkins.ci.plugins.jobloglogger.JobLogLoggerBuildWrapper>
|
||||||
|
</buildWrappers>
|
||||||
|
</project>
|
3
tests/wrappers/fixtures/job-log-logger001.yaml
Normal file
3
tests/wrappers/fixtures/job-log-logger001.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
wrappers:
|
||||||
|
- job-log-logger:
|
||||||
|
suppress-empty: false
|
Loading…
x
Reference in New Issue
Block a user