[英]Gitlab Webhooks (2 Webhooks on the same repo)
所以事情是這樣的,
我們在 Gitlab 的同一個存儲庫上設置了兩個 webhook,
Webhooks number 1 is set to url: http://jenkins.local/project/job1 (build job from master branch ) Webhooks number 2 is set to url: http://jenkins.local/project/job2 (builds job from branch "1")
我們試圖克服的問題是,每當有一個合並請求被打開時,這兩個 web 鈎子都會被觸發。
有沒有辦法“配置” webhook 僅在合並請求進入 master / 1 分支時觸發,
我在設置->集成中沒有找到這樣的設置
目前,限制每個分支的 webhook 選項僅適用於 Push 事件; 用於合並請求事件; 沒有辦法限制/過濾。
你必須在你的 Jenkins 工作中過濾它(哪個工作會被解雇;如果這也是你要找的)作為 GitLab 插件的例子,就像這樣 -
工作1:-
triggers {
gitlabPush {
buildOnMergeRequestEvents(true)
targetBranchRegex('master')
}
}
工作2:-
triggers {
gitlabPush {
buildOnMergeRequestEvents(true)
targetBranchRegex('branch1')
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.