Add labels to lauch build property for gitlab trigger
Change-Id: Id5f965d5fd5f81531401d4727fd5c3d33a5d3b5b
This commit is contained in:
parent
2b166cff8a
commit
1ecedbbe68
@ -1662,6 +1662,8 @@ def gitlab(registry, xml_parent, data):
|
||||
:arg str source-branch-regex: Regular expression to select branches
|
||||
:arg str target-branch-regex: Regular expression to select branches
|
||||
:arg str secret-token: Secret token for build trigger
|
||||
:arg str force-build-labels: Labels that launch a build if they are added
|
||||
(comma-separated)
|
||||
:arg dict merge-request-label-filter-config: If used allow merge requests
|
||||
filtering by labels
|
||||
|
||||
@ -1765,6 +1767,7 @@ def gitlab(registry, xml_parent, data):
|
||||
("source-branch-regex", "sourceBranchRegex", ""),
|
||||
("target-branch-regex", "targetBranchRegex", ""),
|
||||
("secret-token", "secretToken", ""),
|
||||
("force-build-labels", "labelsThatForcesBuildIfAdded", ""),
|
||||
]
|
||||
helpers.convert_mapping_to_xml(gitlab, data, mapping, fail_required=True)
|
||||
|
||||
|
@ -24,6 +24,7 @@
|
||||
<sourceBranchRegex/>
|
||||
<targetBranchRegex/>
|
||||
<secretToken/>
|
||||
<labelsThatForcesBuildIfAdded/>
|
||||
<includeBranchesSpec>master, master2, local-test</includeBranchesSpec>
|
||||
<excludeBranchesSpec>broken-test, master-foo</excludeBranchesSpec>
|
||||
</com.dabsquared.gitlabjenkins.GitLabPushTrigger>
|
||||
|
@ -24,6 +24,7 @@
|
||||
<sourceBranchRegex/>
|
||||
<targetBranchRegex/>
|
||||
<secretToken/>
|
||||
<labelsThatForcesBuildIfAdded/>
|
||||
<includeBranchesSpec>master</includeBranchesSpec>
|
||||
<excludeBranchesSpec>feature</excludeBranchesSpec>
|
||||
</com.dabsquared.gitlabjenkins.GitLabPushTrigger>
|
||||
|
@ -24,6 +24,7 @@
|
||||
<sourceBranchRegex/>
|
||||
<targetBranchRegex/>
|
||||
<secretToken/>
|
||||
<labelsThatForcesBuildIfAdded/>
|
||||
<includeBranchesSpec>master</includeBranchesSpec>
|
||||
<excludeBranchesSpec>baz, foo, fnord</excludeBranchesSpec>
|
||||
</com.dabsquared.gitlabjenkins.GitLabPushTrigger>
|
||||
|
@ -24,6 +24,7 @@
|
||||
<sourceBranchRegex/>
|
||||
<targetBranchRegex/>
|
||||
<secretToken/>
|
||||
<labelsThatForcesBuildIfAdded/>
|
||||
<includeBranchesSpec>master, master2, local-test</includeBranchesSpec>
|
||||
<excludeBranchesSpec>broken-test, master-foo</excludeBranchesSpec>
|
||||
<pendingBuildName>test</pendingBuildName>
|
||||
|
@ -24,6 +24,7 @@
|
||||
<sourceBranchRegex/>
|
||||
<targetBranchRegex/>
|
||||
<secretToken/>
|
||||
<labelsThatForcesBuildIfAdded/>
|
||||
<includeBranchesSpec/>
|
||||
<excludeBranchesSpec/>
|
||||
</com.dabsquared.gitlabjenkins.GitLabPushTrigger>
|
||||
|
@ -24,6 +24,7 @@
|
||||
<sourceBranchRegex/>
|
||||
<targetBranchRegex>(.*debug.*|.*release.*)</targetBranchRegex>
|
||||
<secretToken>secret-build-token</secretToken>
|
||||
<labelsThatForcesBuildIfAdded/>
|
||||
<includeBranchesSpec>include1, include2</includeBranchesSpec>
|
||||
<excludeBranchesSpec>exclude1, exclude2</excludeBranchesSpec>
|
||||
</com.dabsquared.gitlabjenkins.GitLabPushTrigger>
|
||||
|
@ -24,6 +24,7 @@
|
||||
<sourceBranchRegex/>
|
||||
<targetBranchRegex/>
|
||||
<secretToken/>
|
||||
<labelsThatForcesBuildIfAdded/>
|
||||
<includeBranchesSpec>master, master2, local-test</includeBranchesSpec>
|
||||
<excludeBranchesSpec>broken-test, master-foo</excludeBranchesSpec>
|
||||
</com.dabsquared.gitlabjenkins.GitLabPushTrigger>
|
||||
|
@ -24,6 +24,7 @@
|
||||
<sourceBranchRegex/>
|
||||
<targetBranchRegex/>
|
||||
<secretToken/>
|
||||
<labelsThatForcesBuildIfAdded/>
|
||||
<includeBranchesSpec/>
|
||||
<excludeBranchesSpec/>
|
||||
</com.dabsquared.gitlabjenkins.GitLabPushTrigger>
|
||||
|
@ -24,6 +24,7 @@
|
||||
<sourceBranchRegex/>
|
||||
<targetBranchRegex/>
|
||||
<secretToken/>
|
||||
<labelsThatForcesBuildIfAdded/>
|
||||
<includeBranchesSpec/>
|
||||
<excludeBranchesSpec/>
|
||||
<mergeRequestLabelFilterConfig>
|
||||
|
3
tests/triggers/fixtures/gitlab010.plugins_info.yaml
Normal file
3
tests/triggers/fixtures/gitlab010.plugins_info.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
- longName: 'GitLab Plugin'
|
||||
shortName: 'gitlab-plugin'
|
||||
version: "0"
|
32
tests/triggers/fixtures/gitlab010.xml
Normal file
32
tests/triggers/fixtures/gitlab010.xml
Normal file
@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<triggers class="vector">
|
||||
<com.dabsquared.gitlabjenkins.GitLabPushTrigger>
|
||||
<triggerOpenMergeRequestOnPush>true</triggerOpenMergeRequestOnPush>
|
||||
<branchFilterName/>
|
||||
<spec/>
|
||||
<triggerOnPush>true</triggerOnPush>
|
||||
<triggerOnMergeRequest>true</triggerOnMergeRequest>
|
||||
<triggerOnlyIfNewCommitsPushed>false</triggerOnlyIfNewCommitsPushed>
|
||||
<triggerOnAcceptedMergeRequest>false</triggerOnAcceptedMergeRequest>
|
||||
<triggerOnClosedMergeRequest>false</triggerOnClosedMergeRequest>
|
||||
<triggerOnNoteRequest>true</triggerOnNoteRequest>
|
||||
<noteRegex>Jenkins please retry a build</noteRegex>
|
||||
<ciSkip>true</ciSkip>
|
||||
<skipWorkInProgressMergeRequest>true</skipWorkInProgressMergeRequest>
|
||||
<setBuildDescription>true</setBuildDescription>
|
||||
<cancelPendingBuildsOnUpdate>false</cancelPendingBuildsOnUpdate>
|
||||
<addNoteOnMergeRequest>true</addNoteOnMergeRequest>
|
||||
<addVoteOnMergeRequest>true</addVoteOnMergeRequest>
|
||||
<acceptMergeRequestOnSuccess>false</acceptMergeRequestOnSuccess>
|
||||
<addCiMessage>false</addCiMessage>
|
||||
<allowAllBranches>false</allowAllBranches>
|
||||
<sourceBranchRegex/>
|
||||
<targetBranchRegex/>
|
||||
<secretToken/>
|
||||
<labelsThatForcesBuildIfAdded>ForceBuildLabel</labelsThatForcesBuildIfAdded>
|
||||
<includeBranchesSpec/>
|
||||
<excludeBranchesSpec/>
|
||||
</com.dabsquared.gitlabjenkins.GitLabPushTrigger>
|
||||
</triggers>
|
||||
</project>
|
3
tests/triggers/fixtures/gitlab010.yaml
Normal file
3
tests/triggers/fixtures/gitlab010.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
triggers:
|
||||
- gitlab:
|
||||
force-build-labels: ForceBuildLabel
|
Loading…
Reference in New Issue
Block a user