Add Gogs Plugin
Change-Id: I0230a605fd2c3d0c8f7df2c497f3b837499f8758
This commit is contained in:
parent
2563ae4ef0
commit
fedd4b52ab
@ -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.
|
||||
|
@ -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
|
||||
|
9
tests/properties/fixtures/gogs-full.xml
Normal file
9
tests/properties/fixtures/gogs-full.xml
Normal 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>
|
4
tests/properties/fixtures/gogs-full.yaml
Normal file
4
tests/properties/fixtures/gogs-full.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
properties:
|
||||
- gogs:
|
||||
branch-filter: 'master'
|
||||
secret: 'yoursecret'
|
9
tests/properties/fixtures/gogs-minimal.xml
Normal file
9
tests/properties/fixtures/gogs-minimal.xml
Normal 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>
|
2
tests/properties/fixtures/gogs-minimal.yaml
Normal file
2
tests/properties/fixtures/gogs-minimal.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
properties:
|
||||
- gogs
|
8
tests/triggers/fixtures/gogs.xml
Normal file
8
tests/triggers/fixtures/gogs.xml
Normal 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>
|
2
tests/triggers/fixtures/gogs.yaml
Normal file
2
tests/triggers/fixtures/gogs.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
triggers:
|
||||
- gogs
|
Loading…
Reference in New Issue
Block a user