Merge "gitlab trigger: add support for different MR events"
This commit is contained in:
commit
c1a73eb7cc
@ -1225,6 +1225,10 @@ def gitlab(registry, xml_parent, data):
|
|||||||
:arg bool trigger-push: Build on Push Events (default true)
|
:arg bool trigger-push: Build on Push Events (default true)
|
||||||
:arg bool trigger-merge-request: Build on Merge Request Events (default
|
:arg bool trigger-merge-request: Build on Merge Request Events (default
|
||||||
true)
|
true)
|
||||||
|
:arg bool trigger-accepted-merge-request: Build on Accepted Merge Request
|
||||||
|
Events (>= 1.4.6) (default false)
|
||||||
|
:arg bool trigger-closed-merge-request: Build on Closed Merge Request
|
||||||
|
Events (>= 1.4.6) (default false)
|
||||||
:arg str trigger-open-merge-request-push: Rebuild open Merge Requests
|
:arg str trigger-open-merge-request-push: Rebuild open Merge Requests
|
||||||
on Push Events.
|
on Push Events.
|
||||||
|
|
||||||
@ -1343,6 +1347,9 @@ def gitlab(registry, xml_parent, data):
|
|||||||
mapping = [
|
mapping = [
|
||||||
('trigger-push', 'triggerOnPush', True),
|
('trigger-push', 'triggerOnPush', True),
|
||||||
('trigger-merge-request', 'triggerOnMergeRequest', True),
|
('trigger-merge-request', 'triggerOnMergeRequest', True),
|
||||||
|
('trigger-accepted-merge-request', 'triggerOnAcceptedMergeRequest',
|
||||||
|
False),
|
||||||
|
('trigger-closed-merge-request', 'triggerOnClosedMergeRequest', False),
|
||||||
('trigger-note', 'triggerOnNoteRequest', True),
|
('trigger-note', 'triggerOnNoteRequest', True),
|
||||||
('note-regex', 'noteRegex', 'Jenkins please retry a build'),
|
('note-regex', 'noteRegex', 'Jenkins please retry a build'),
|
||||||
('ci-skip', 'ciSkip', True),
|
('ci-skip', 'ciSkip', True),
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
<spec/>
|
<spec/>
|
||||||
<triggerOnPush>true</triggerOnPush>
|
<triggerOnPush>true</triggerOnPush>
|
||||||
<triggerOnMergeRequest>true</triggerOnMergeRequest>
|
<triggerOnMergeRequest>true</triggerOnMergeRequest>
|
||||||
|
<triggerOnAcceptedMergeRequest>false</triggerOnAcceptedMergeRequest>
|
||||||
|
<triggerOnClosedMergeRequest>false</triggerOnClosedMergeRequest>
|
||||||
<triggerOnNoteRequest>true</triggerOnNoteRequest>
|
<triggerOnNoteRequest>true</triggerOnNoteRequest>
|
||||||
<noteRegex>Jenkins please retry a build</noteRegex>
|
<noteRegex>Jenkins please retry a build</noteRegex>
|
||||||
<ciSkip>true</ciSkip>
|
<ciSkip>true</ciSkip>
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
<spec/>
|
<spec/>
|
||||||
<triggerOnPush>true</triggerOnPush>
|
<triggerOnPush>true</triggerOnPush>
|
||||||
<triggerOnMergeRequest>true</triggerOnMergeRequest>
|
<triggerOnMergeRequest>true</triggerOnMergeRequest>
|
||||||
|
<triggerOnAcceptedMergeRequest>false</triggerOnAcceptedMergeRequest>
|
||||||
|
<triggerOnClosedMergeRequest>false</triggerOnClosedMergeRequest>
|
||||||
<triggerOnNoteRequest>true</triggerOnNoteRequest>
|
<triggerOnNoteRequest>true</triggerOnNoteRequest>
|
||||||
<noteRegex>Jenkins please retry a build</noteRegex>
|
<noteRegex>Jenkins please retry a build</noteRegex>
|
||||||
<ciSkip>true</ciSkip>
|
<ciSkip>true</ciSkip>
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
<spec/>
|
<spec/>
|
||||||
<triggerOnPush>true</triggerOnPush>
|
<triggerOnPush>true</triggerOnPush>
|
||||||
<triggerOnMergeRequest>true</triggerOnMergeRequest>
|
<triggerOnMergeRequest>true</triggerOnMergeRequest>
|
||||||
|
<triggerOnAcceptedMergeRequest>false</triggerOnAcceptedMergeRequest>
|
||||||
|
<triggerOnClosedMergeRequest>false</triggerOnClosedMergeRequest>
|
||||||
<triggerOnNoteRequest>true</triggerOnNoteRequest>
|
<triggerOnNoteRequest>true</triggerOnNoteRequest>
|
||||||
<noteRegex>Jenkins please retry a build</noteRegex>
|
<noteRegex>Jenkins please retry a build</noteRegex>
|
||||||
<ciSkip>true</ciSkip>
|
<ciSkip>true</ciSkip>
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
<spec/>
|
<spec/>
|
||||||
<triggerOnPush>false</triggerOnPush>
|
<triggerOnPush>false</triggerOnPush>
|
||||||
<triggerOnMergeRequest>false</triggerOnMergeRequest>
|
<triggerOnMergeRequest>false</triggerOnMergeRequest>
|
||||||
|
<triggerOnAcceptedMergeRequest>false</triggerOnAcceptedMergeRequest>
|
||||||
|
<triggerOnClosedMergeRequest>false</triggerOnClosedMergeRequest>
|
||||||
<triggerOnNoteRequest>true</triggerOnNoteRequest>
|
<triggerOnNoteRequest>true</triggerOnNoteRequest>
|
||||||
<noteRegex>Jenkins please retry a build</noteRegex>
|
<noteRegex>Jenkins please retry a build</noteRegex>
|
||||||
<ciSkip>false</ciSkip>
|
<ciSkip>false</ciSkip>
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
<spec/>
|
<spec/>
|
||||||
<triggerOnPush>true</triggerOnPush>
|
<triggerOnPush>true</triggerOnPush>
|
||||||
<triggerOnMergeRequest>true</triggerOnMergeRequest>
|
<triggerOnMergeRequest>true</triggerOnMergeRequest>
|
||||||
|
<triggerOnAcceptedMergeRequest>false</triggerOnAcceptedMergeRequest>
|
||||||
|
<triggerOnClosedMergeRequest>false</triggerOnClosedMergeRequest>
|
||||||
<triggerOnNoteRequest>true</triggerOnNoteRequest>
|
<triggerOnNoteRequest>true</triggerOnNoteRequest>
|
||||||
<noteRegex>Jenkins please retry a build</noteRegex>
|
<noteRegex>Jenkins please retry a build</noteRegex>
|
||||||
<ciSkip>true</ciSkip>
|
<ciSkip>true</ciSkip>
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
<spec/>
|
<spec/>
|
||||||
<triggerOnPush>false</triggerOnPush>
|
<triggerOnPush>false</triggerOnPush>
|
||||||
<triggerOnMergeRequest>false</triggerOnMergeRequest>
|
<triggerOnMergeRequest>false</triggerOnMergeRequest>
|
||||||
|
<triggerOnAcceptedMergeRequest>false</triggerOnAcceptedMergeRequest>
|
||||||
|
<triggerOnClosedMergeRequest>false</triggerOnClosedMergeRequest>
|
||||||
<triggerOnNoteRequest>true</triggerOnNoteRequest>
|
<triggerOnNoteRequest>true</triggerOnNoteRequest>
|
||||||
<noteRegex>Retrigger</noteRegex>
|
<noteRegex>Retrigger</noteRegex>
|
||||||
<ciSkip>false</ciSkip>
|
<ciSkip>false</ciSkip>
|
||||||
|
3
tests/triggers/fixtures/gitlab007.plugins_info.yaml
Normal file
3
tests/triggers/fixtures/gitlab007.plugins_info.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
- longName: 'GitLab Plugin'
|
||||||
|
shortName: 'gitlab-plugin'
|
||||||
|
version: "1.4.6"
|
27
tests/triggers/fixtures/gitlab007.xml
Normal file
27
tests/triggers/fixtures/gitlab007.xml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<project>
|
||||||
|
<triggers class="vector">
|
||||||
|
<com.dabsquared.gitlabjenkins.GitLabPushTrigger>
|
||||||
|
<triggerOpenMergeRequestOnPush>never</triggerOpenMergeRequestOnPush>
|
||||||
|
<branchFilterType>All</branchFilterType>
|
||||||
|
<spec/>
|
||||||
|
<triggerOnPush>true</triggerOnPush>
|
||||||
|
<triggerOnMergeRequest>true</triggerOnMergeRequest>
|
||||||
|
<triggerOnAcceptedMergeRequest>true</triggerOnAcceptedMergeRequest>
|
||||||
|
<triggerOnClosedMergeRequest>true</triggerOnClosedMergeRequest>
|
||||||
|
<triggerOnNoteRequest>true</triggerOnNoteRequest>
|
||||||
|
<noteRegex>Jenkins please retry a build</noteRegex>
|
||||||
|
<ciSkip>true</ciSkip>
|
||||||
|
<skipWorkInProgressMergeRequest>true</skipWorkInProgressMergeRequest>
|
||||||
|
<setBuildDescription>true</setBuildDescription>
|
||||||
|
<addNoteOnMergeRequest>true</addNoteOnMergeRequest>
|
||||||
|
<addVoteOnMergeRequest>true</addVoteOnMergeRequest>
|
||||||
|
<acceptMergeRequestOnSuccess>false</acceptMergeRequestOnSuccess>
|
||||||
|
<addCiMessage>true</addCiMessage>
|
||||||
|
<allowAllBranches>true</allowAllBranches>
|
||||||
|
<targetBranchRegex/>
|
||||||
|
<includeBranchesSpec>master, master2, local-test</includeBranchesSpec>
|
||||||
|
<excludeBranchesSpec>broken-test, master-foo</excludeBranchesSpec>
|
||||||
|
</com.dabsquared.gitlabjenkins.GitLabPushTrigger>
|
||||||
|
</triggers>
|
||||||
|
</project>
|
19
tests/triggers/fixtures/gitlab007.yaml
Normal file
19
tests/triggers/fixtures/gitlab007.yaml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
triggers:
|
||||||
|
- gitlab:
|
||||||
|
trigger-push: true
|
||||||
|
trigger-merge-request: true
|
||||||
|
trigger-accepted-merge-request: true
|
||||||
|
trigger-closed-merge-request: true
|
||||||
|
ci-skip: true
|
||||||
|
set-build-description: true
|
||||||
|
add-note-merge-request: true
|
||||||
|
add-vote-merge-request: true
|
||||||
|
add-ci-message: true
|
||||||
|
allow-all-branches: true
|
||||||
|
include-branches:
|
||||||
|
- 'master'
|
||||||
|
- 'master2'
|
||||||
|
- 'local-test'
|
||||||
|
exclude-branches:
|
||||||
|
- 'broken-test'
|
||||||
|
- 'master-foo'
|
3
tests/triggers/fixtures/gitlab008.plugins_info.yaml
Normal file
3
tests/triggers/fixtures/gitlab008.plugins_info.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
- longName: 'GitLab Plugin'
|
||||||
|
shortName: 'gitlab-plugin'
|
||||||
|
version: "1.1.26"
|
27
tests/triggers/fixtures/gitlab008.xml
Normal file
27
tests/triggers/fixtures/gitlab008.xml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<project>
|
||||||
|
<triggers class="vector">
|
||||||
|
<com.dabsquared.gitlabjenkins.GitLabPushTrigger>
|
||||||
|
<triggerOpenMergeRequestOnPush>both</triggerOpenMergeRequestOnPush>
|
||||||
|
<branchFilterName/>
|
||||||
|
<spec/>
|
||||||
|
<triggerOnPush>false</triggerOnPush>
|
||||||
|
<triggerOnMergeRequest>false</triggerOnMergeRequest>
|
||||||
|
<triggerOnAcceptedMergeRequest>false</triggerOnAcceptedMergeRequest>
|
||||||
|
<triggerOnClosedMergeRequest>false</triggerOnClosedMergeRequest>
|
||||||
|
<triggerOnNoteRequest>true</triggerOnNoteRequest>
|
||||||
|
<noteRegex>Jenkins please retry a build</noteRegex>
|
||||||
|
<ciSkip>false</ciSkip>
|
||||||
|
<skipWorkInProgressMergeRequest>true</skipWorkInProgressMergeRequest>
|
||||||
|
<setBuildDescription>false</setBuildDescription>
|
||||||
|
<addNoteOnMergeRequest>false</addNoteOnMergeRequest>
|
||||||
|
<addVoteOnMergeRequest>false</addVoteOnMergeRequest>
|
||||||
|
<acceptMergeRequestOnSuccess>false</acceptMergeRequestOnSuccess>
|
||||||
|
<addCiMessage>true</addCiMessage>
|
||||||
|
<allowAllBranches>false</allowAllBranches>
|
||||||
|
<targetBranchRegex/>
|
||||||
|
<includeBranchesSpec/>
|
||||||
|
<excludeBranchesSpec/>
|
||||||
|
</com.dabsquared.gitlabjenkins.GitLabPushTrigger>
|
||||||
|
</triggers>
|
||||||
|
</project>
|
11
tests/triggers/fixtures/gitlab008.yaml
Normal file
11
tests/triggers/fixtures/gitlab008.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
triggers:
|
||||||
|
- gitlab:
|
||||||
|
trigger-push: false
|
||||||
|
trigger-merge-request: false
|
||||||
|
trigger-open-merge-request-push: both
|
||||||
|
ci-skip: false
|
||||||
|
set-build-description: false
|
||||||
|
add-note-merge-request: false
|
||||||
|
add-vote-merge-request: false
|
||||||
|
add-ci-message: true
|
||||||
|
branch-filter-type: All
|
Loading…
x
Reference in New Issue
Block a user