Merge "Add Gogs Plugin"

This commit is contained in:
Zuul 2021-01-17 14:16:28 +00:00 committed by Gerrit Code Review
commit cbc9876189
8 changed files with 74 additions and 0 deletions

View File

@ -230,6 +230,30 @@ def gitlab_logo(registry, xml_parent, data):
helpers.convert_mapping_to_xml(logo, data, mapping, fail_required=True)
def gogs(registry, xml_parent, data):
"""yaml: gogs
Sets the Gogs webhook properties for the project.
Requires the Jenkins :jenkins-plugins:`Gogs Plugin <gogs-webhook>`.
:arg str secret: webhook secret (default '')
:arg str branch-filter: filter which needs to match to trigger a job (default '')
Minimal Example:
.. literalinclude:: /../../tests/properties/fixtures/gogs-minimal.yaml
:language: yaml
Full Example:
.. literalinclude:: /../../tests/properties/fixtures/gogs-full.yaml
:language: yaml
"""
gogs = XML.SubElement(xml_parent, "org.jenkinsci.plugins.gogs.GogsProjectProperty")
mapping = [("branch-filter", "gogsBranchFilter", ""), ("secret", "gogsSecret", "")]
helpers.convert_mapping_to_xml(gogs, data, mapping)
def naginator_opt_out(registry, xml_parent, data):
"""yaml: naginator-opt-out
Lets you opt-out so no rebuild option for Naginator is added.

View File

@ -1705,6 +1705,22 @@ def gitlab(registry, xml_parent, data):
_add_xml(gitlab, xml_name, value)
def gogs(registry, xml_parent, data):
"""yaml: gogs
Trigger a job when gogs repository is pushed to.
Requires the Jenkins :jenkins-plugins:`Gogs Plugin <gogs-webhook>`.
Example:
.. literalinclude::
/../../tests/triggers/fixtures/gogs.yaml
:language: yaml
"""
gogstrig = XML.SubElement(xml_parent, "org.jenkinsci.plugins.gogs.GogsTrigger")
XML.SubElement(gogstrig, "spec")
def build_result(registry, xml_parent, data):
"""yaml: build-result
Configure jobB to monitor jobA build result. A build is scheduled if there

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<properties>
<org.jenkinsci.plugins.gogs.GogsProjectProperty>
<gogsBranchFilter>master</gogsBranchFilter>
<gogsSecret>yoursecret</gogsSecret>
</org.jenkinsci.plugins.gogs.GogsProjectProperty>
</properties>
</project>

View File

@ -0,0 +1,4 @@
properties:
- gogs:
branch-filter: 'master'
secret: 'yoursecret'

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<properties>
<org.jenkinsci.plugins.gogs.GogsProjectProperty>
<gogsBranchFilter/>
<gogsSecret/>
</org.jenkinsci.plugins.gogs.GogsProjectProperty>
</properties>
</project>

View File

@ -0,0 +1,2 @@
properties:
- gogs

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<triggers class="vector">
<org.jenkinsci.plugins.gogs.GogsTrigger>
<spec/>
</org.jenkinsci.plugins.gogs.GogsTrigger>
</triggers>
</project>

View File

@ -0,0 +1,2 @@
triggers:
- gogs