Add labels to lauch build property for gitlab trigger

Change-Id: Id5f965d5fd5f81531401d4727fd5c3d33a5d3b5b
This commit is contained in:
Vsevolod Fedorov 2024-06-01 17:12:30 +03:00
parent 2b166cff8a
commit 1ecedbbe68
13 changed files with 50 additions and 0 deletions

View File

@ -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)

View File

@ -24,6 +24,7 @@
<sourceBranchRegex/>
<targetBranchRegex/>
<secretToken/>
<labelsThatForcesBuildIfAdded/>
<includeBranchesSpec>master, master2, local-test</includeBranchesSpec>
<excludeBranchesSpec>broken-test, master-foo</excludeBranchesSpec>
</com.dabsquared.gitlabjenkins.GitLabPushTrigger>

View File

@ -24,6 +24,7 @@
<sourceBranchRegex/>
<targetBranchRegex/>
<secretToken/>
<labelsThatForcesBuildIfAdded/>
<includeBranchesSpec>master</includeBranchesSpec>
<excludeBranchesSpec>feature</excludeBranchesSpec>
</com.dabsquared.gitlabjenkins.GitLabPushTrigger>

View File

@ -24,6 +24,7 @@
<sourceBranchRegex/>
<targetBranchRegex/>
<secretToken/>
<labelsThatForcesBuildIfAdded/>
<includeBranchesSpec>master</includeBranchesSpec>
<excludeBranchesSpec>baz, foo, fnord</excludeBranchesSpec>
</com.dabsquared.gitlabjenkins.GitLabPushTrigger>

View File

@ -24,6 +24,7 @@
<sourceBranchRegex/>
<targetBranchRegex/>
<secretToken/>
<labelsThatForcesBuildIfAdded/>
<includeBranchesSpec>master, master2, local-test</includeBranchesSpec>
<excludeBranchesSpec>broken-test, master-foo</excludeBranchesSpec>
<pendingBuildName>test</pendingBuildName>

View File

@ -24,6 +24,7 @@
<sourceBranchRegex/>
<targetBranchRegex/>
<secretToken/>
<labelsThatForcesBuildIfAdded/>
<includeBranchesSpec/>
<excludeBranchesSpec/>
</com.dabsquared.gitlabjenkins.GitLabPushTrigger>

View File

@ -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>

View File

@ -24,6 +24,7 @@
<sourceBranchRegex/>
<targetBranchRegex/>
<secretToken/>
<labelsThatForcesBuildIfAdded/>
<includeBranchesSpec>master, master2, local-test</includeBranchesSpec>
<excludeBranchesSpec>broken-test, master-foo</excludeBranchesSpec>
</com.dabsquared.gitlabjenkins.GitLabPushTrigger>

View File

@ -24,6 +24,7 @@
<sourceBranchRegex/>
<targetBranchRegex/>
<secretToken/>
<labelsThatForcesBuildIfAdded/>
<includeBranchesSpec/>
<excludeBranchesSpec/>
</com.dabsquared.gitlabjenkins.GitLabPushTrigger>

View File

@ -24,6 +24,7 @@
<sourceBranchRegex/>
<targetBranchRegex/>
<secretToken/>
<labelsThatForcesBuildIfAdded/>
<includeBranchesSpec/>
<excludeBranchesSpec/>
<mergeRequestLabelFilterConfig>

View File

@ -0,0 +1,3 @@
- longName: 'GitLab Plugin'
shortName: 'gitlab-plugin'
version: "0"

View 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>

View File

@ -0,0 +1,3 @@
triggers:
- gitlab:
force-build-labels: ForceBuildLabel