Merge "Remove nonexistent servername and cleanup build publisher"
This commit is contained in:
commit
f14589b14d
|
@ -3328,42 +3328,37 @@ def build_publisher(parser, xml_parent, data):
|
|||
Requires the Jenkins :jenkins-wiki:`Build Publisher Plugin
|
||||
<Build+Publisher+Plugin>`.
|
||||
|
||||
:arg str servers: Specify the servers where to publish
|
||||
:arg bool publish-unstable-builds: publish unstable builds (default: true)
|
||||
:arg bool publish-failed-builds: publish failed builds (default: true)
|
||||
:arg int days-to-keep: days to keep when publishing results (optional)
|
||||
:arg int num-to-keep: number of jobs to keep in the published results
|
||||
(optional)
|
||||
|
||||
Example:
|
||||
|
||||
Example::
|
||||
|
||||
publishers:
|
||||
- build-publisher:
|
||||
name: servername
|
||||
publish-unstable-builds: true
|
||||
publish-failed-builds: true
|
||||
days-to-keep: -1
|
||||
num-to-keep: -1
|
||||
artifact-days-to-keep: -1
|
||||
artifact-num-to-keep: -1
|
||||
|
||||
.. literalinclude::
|
||||
/../../tests/publishers/fixtures/build-publisher002.yaml
|
||||
"""
|
||||
|
||||
reporter = XML.SubElement(
|
||||
xml_parent,
|
||||
'hudson.plugins.build__publisher.BuildPublisher')
|
||||
|
||||
XML.SubElement(reporter, 'serverName').text = data['name']
|
||||
XML.SubElement(reporter, 'publishUnstableBuilds').text = \
|
||||
str(data.get('publish-unstable-builds', True)).lower()
|
||||
XML.SubElement(reporter, 'publishFailedBuilds').text = \
|
||||
str(data.get('publish-failed-builds', True)).lower()
|
||||
|
||||
logrotator = XML.SubElement(reporter, 'logRotator')
|
||||
XML.SubElement(logrotator, 'daysToKeep').text = \
|
||||
str(data.get('days-to-keep', -1))
|
||||
XML.SubElement(logrotator, 'numToKeep').text = \
|
||||
str(data.get('num-to-keep', -1))
|
||||
XML.SubElement(logrotator, 'artifactDaysToKeep').text = \
|
||||
str(data.get('artifact-days-to-keep', -1))
|
||||
XML.SubElement(logrotator, 'artifactNumToKeep').text = \
|
||||
str(data.get('artifact-num-to-keep', -1))
|
||||
if 'days-to-keep' in data or 'num-to-keep' in data:
|
||||
logrotator = XML.SubElement(reporter, 'logRotator')
|
||||
XML.SubElement(logrotator, 'daysToKeep').text = \
|
||||
str(data.get('days-to-keep', -1))
|
||||
XML.SubElement(logrotator, 'numToKeep').text = \
|
||||
str(data.get('num-to-keep', -1))
|
||||
# hardcoded to -1 to emulate what the build publisher
|
||||
# plugin seem to do.
|
||||
XML.SubElement(logrotator, 'artifactDaysToKeep').text = "-1"
|
||||
XML.SubElement(logrotator, 'artifactNumToKeep').text = "-1"
|
||||
|
||||
|
||||
def stash(parser, xml_parent, data):
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<publishers>
|
||||
<hudson.plugins.build__publisher.BuildPublisher>
|
||||
<publishUnstableBuilds>true</publishUnstableBuilds>
|
||||
<publishFailedBuilds>true</publishFailedBuilds>
|
||||
</hudson.plugins.build__publisher.BuildPublisher>
|
||||
</publishers>
|
||||
</project>
|
|
@ -0,0 +1,4 @@
|
|||
publishers:
|
||||
- build-publisher:
|
||||
publish-unstable-builds: true
|
||||
publish-failed-builds: true
|
|
@ -2,14 +2,13 @@
|
|||
<project>
|
||||
<publishers>
|
||||
<hudson.plugins.build__publisher.BuildPublisher>
|
||||
<serverName>servername</serverName>
|
||||
<publishUnstableBuilds>true</publishUnstableBuilds>
|
||||
<publishFailedBuilds>false</publishFailedBuilds>
|
||||
<publishFailedBuilds>true</publishFailedBuilds>
|
||||
<logRotator>
|
||||
<daysToKeep>-1</daysToKeep>
|
||||
<numToKeep>100</numToKeep>
|
||||
<artifactDaysToKeep>-1</artifactDaysToKeep>
|
||||
<artifactNumToKeep>100</artifactNumToKeep>
|
||||
<artifactNumToKeep>-1</artifactNumToKeep>
|
||||
</logRotator>
|
||||
</hudson.plugins.build__publisher.BuildPublisher>
|
||||
</publishers>
|
|
@ -0,0 +1,6 @@
|
|||
publishers:
|
||||
- build-publisher:
|
||||
publish-unstable-builds: true
|
||||
publish-failed-builds: true
|
||||
days-to-keep: -1
|
||||
num-to-keep: 100
|
|
@ -1,9 +0,0 @@
|
|||
publishers:
|
||||
- build-publisher:
|
||||
name: servername
|
||||
publish-unstable-builds: true
|
||||
publish-failed-builds: false
|
||||
days-to-keep: -1
|
||||
num-to-keep: 100
|
||||
artifact-days-to-keep: -1
|
||||
artifact-num-to-keep: 100
|
Loading…
Reference in New Issue