Merge "Remove nonexistent servername and cleanup build publisher"

This commit is contained in:
Jenkins 2015-03-19 23:34:45 +00:00 committed by Gerrit Code Review
commit f14589b14d
6 changed files with 39 additions and 35 deletions

View File

@ -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):

View File

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

View File

@ -0,0 +1,4 @@
publishers:
- build-publisher:
publish-unstable-builds: true
publish-failed-builds: true

View File

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

View File

@ -0,0 +1,6 @@
publishers:
- build-publisher:
publish-unstable-builds: true
publish-failed-builds: true
days-to-keep: -1
num-to-keep: 100

View File

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