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
|
Requires the Jenkins :jenkins-wiki:`Build Publisher Plugin
|
||||||
<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::
|
.. literalinclude::
|
||||||
|
/../../tests/publishers/fixtures/build-publisher002.yaml
|
||||||
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
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
reporter = XML.SubElement(
|
reporter = XML.SubElement(
|
||||||
xml_parent,
|
xml_parent,
|
||||||
'hudson.plugins.build__publisher.BuildPublisher')
|
'hudson.plugins.build__publisher.BuildPublisher')
|
||||||
|
|
||||||
XML.SubElement(reporter, 'serverName').text = data['name']
|
|
||||||
XML.SubElement(reporter, 'publishUnstableBuilds').text = \
|
XML.SubElement(reporter, 'publishUnstableBuilds').text = \
|
||||||
str(data.get('publish-unstable-builds', True)).lower()
|
str(data.get('publish-unstable-builds', True)).lower()
|
||||||
XML.SubElement(reporter, 'publishFailedBuilds').text = \
|
XML.SubElement(reporter, 'publishFailedBuilds').text = \
|
||||||
str(data.get('publish-failed-builds', True)).lower()
|
str(data.get('publish-failed-builds', True)).lower()
|
||||||
|
|
||||||
|
if 'days-to-keep' in data or 'num-to-keep' in data:
|
||||||
logrotator = XML.SubElement(reporter, 'logRotator')
|
logrotator = XML.SubElement(reporter, 'logRotator')
|
||||||
XML.SubElement(logrotator, 'daysToKeep').text = \
|
XML.SubElement(logrotator, 'daysToKeep').text = \
|
||||||
str(data.get('days-to-keep', -1))
|
str(data.get('days-to-keep', -1))
|
||||||
XML.SubElement(logrotator, 'numToKeep').text = \
|
XML.SubElement(logrotator, 'numToKeep').text = \
|
||||||
str(data.get('num-to-keep', -1))
|
str(data.get('num-to-keep', -1))
|
||||||
XML.SubElement(logrotator, 'artifactDaysToKeep').text = \
|
# hardcoded to -1 to emulate what the build publisher
|
||||||
str(data.get('artifact-days-to-keep', -1))
|
# plugin seem to do.
|
||||||
XML.SubElement(logrotator, 'artifactNumToKeep').text = \
|
XML.SubElement(logrotator, 'artifactDaysToKeep').text = "-1"
|
||||||
str(data.get('artifact-num-to-keep', -1))
|
XML.SubElement(logrotator, 'artifactNumToKeep').text = "-1"
|
||||||
|
|
||||||
|
|
||||||
def stash(parser, xml_parent, data):
|
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>
|
<project>
|
||||||
<publishers>
|
<publishers>
|
||||||
<hudson.plugins.build__publisher.BuildPublisher>
|
<hudson.plugins.build__publisher.BuildPublisher>
|
||||||
<serverName>servername</serverName>
|
|
||||||
<publishUnstableBuilds>true</publishUnstableBuilds>
|
<publishUnstableBuilds>true</publishUnstableBuilds>
|
||||||
<publishFailedBuilds>false</publishFailedBuilds>
|
<publishFailedBuilds>true</publishFailedBuilds>
|
||||||
<logRotator>
|
<logRotator>
|
||||||
<daysToKeep>-1</daysToKeep>
|
<daysToKeep>-1</daysToKeep>
|
||||||
<numToKeep>100</numToKeep>
|
<numToKeep>100</numToKeep>
|
||||||
<artifactDaysToKeep>-1</artifactDaysToKeep>
|
<artifactDaysToKeep>-1</artifactDaysToKeep>
|
||||||
<artifactNumToKeep>100</artifactNumToKeep>
|
<artifactNumToKeep>-1</artifactNumToKeep>
|
||||||
</logRotator>
|
</logRotator>
|
||||||
</hudson.plugins.build__publisher.BuildPublisher>
|
</hudson.plugins.build__publisher.BuildPublisher>
|
||||||
</publishers>
|
</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