繁体   English   中英

Jenkins用git稀疏结账触发

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM