Merge "publishers: add args to gitlab publisher"

This commit is contained in:
Zuul 2017-10-27 03:36:33 +00:00 committed by Gerrit Code Review
commit c1c67fcdf5
6 changed files with 44 additions and 9 deletions

View File

@ -4390,14 +4390,33 @@ def gitlab_notifier(registry, xml_parent, data):
Set build status on GitLab commit.
Requires the Jenkins :jenkins-wiki:`GitLab Plugin <GitLab+Plugin>`.
Example:
:arg str name: The name of the build in GitLab. With this you can
distinguish different Jenkins jobs for the same commit in GitLab.
(default 'jenkins')
:arg bool mark-unstable-as-success: (default false)
.. literalinclude:: /../../tests/publishers/fixtures/gitlab-notifier.yaml
Minimal Example:
.. literalinclude::
/../../tests/publishers/fixtures/gitlab-notifier-minimal.yaml
:language: yaml
Full Example:
.. literalinclude::
/../../tests/publishers/fixtures/gitlab-notifier-full.yaml
:language: yaml
"""
XML.SubElement(
top = XML.SubElement(
xml_parent,
'com.dabsquared.gitlabjenkins.publisher.GitLabCommitStatusPublisher')
top.set('plugin', 'gitlab-plugin')
mappings = [
('name', 'name', 'jenkins'),
('mark-unstable-as-success', 'markUnstableAsSuccess', False),
]
helpers.convert_mapping_to_xml(top, data, mappings, fail_required=True)
def zulip(registry, xml_parent, data):

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<com.dabsquared.gitlabjenkins.publisher.GitLabCommitStatusPublisher plugin="gitlab-plugin">
<name>foobar-jenkins</name>
<markUnstableAsSuccess>true</markUnstableAsSuccess>
</com.dabsquared.gitlabjenkins.publisher.GitLabCommitStatusPublisher>
</publishers>
</project>

View File

@ -0,0 +1,4 @@
publishers:
- gitlab-notifier:
name: foobar-jenkins
mark-unstable-as-success: true

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<com.dabsquared.gitlabjenkins.publisher.GitLabCommitStatusPublisher plugin="gitlab-plugin">
<name>jenkins</name>
<markUnstableAsSuccess>false</markUnstableAsSuccess>
</com.dabsquared.gitlabjenkins.publisher.GitLabCommitStatusPublisher>
</publishers>
</project>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<com.dabsquared.gitlabjenkins.publisher.GitLabCommitStatusPublisher/>
</publishers>
</project>