是否可以定义由Gitlab启动的多个作业触发器?
我想要实现这样的行为:在向master
分支的打开合并请求中触发构建,而在对名称以-rc[number]
结尾的分支的推送中触发其他构建。
我试图通过以下方式实现这一目标:
pipelineTriggers([
[
$class: 'GitLabPushTrigger',
triggerOnPush: true,
triggerOnMergeRequest: false,
...
branchFilterType: "RegexBasedFilter",
targetBranchRegex: '^.*-rc[0-9]+$',
],
[
$class: 'GitLabPushTrigger',
triggerOnPush: false,
triggerOnMergeRequest: true,
triggerOpenMergeRequestOnPush: "source",
...
branchFilterType: "NameBasedFilter",
includeBranchesSpec: "master",
excludeBranchesSpec: "",
]
])
但它不起作用。