[英]Jenkins triggers with git sparse checkout
我有一個很大的git存儲庫,我在Jenkins中為它創建了多個作業。
我使用git sparse checkout功能每次只同步它的必要部分。
此外,我希望只有在代碼的相關部分發生更改時才會觸發SCM輪詢功能。 實際上,無論提交什么,它都會觸發所有作業。
我的問題:如何確保只在相關文件發生變化時觸發作業?
此外,從“Jenkins輪詢GIT”切換到“從Gitlab觸發”是否可以解決這個問題?
在Jenkins Git插件的Additional Behaviours
下拉列表下有一個選項,名為Polling ignores commit in certain paths.
在那里,您可以指定包含和排除的路徑來控制SCM輪詢的行為。
從插件的文檔:
Each inclusion uses regular expression pattern matching, and must be separated by a new line.
An empty list implies that everything is included.
myapp/src/main/web/.*\.html
myapp/src/main/web/.*\.jpeg
myapp/src/main/web/.*\.gif
The example above illustrates that a build will only occur, if html/jpeg/gif files have been committed to the SCM.
Exclusions take precedence over inclusions, if there is an overlap between included and excluded regions.
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.