简体   繁体   English

Jenkins如何确定GIT存储库中特定文件夹中的更改?

[英]How Jenkins can determine change in a specific folder for a GIT repo?

I have a Git Repo which has multiple folders. 我有一个有多个文件夹的Git Repo。 Each folder is a component of an application. 每个文件夹都是应用程序的组成部分。 We want to detect commits in a specific folder so that we can build individual component which had the latest commit. 我们想要检测特定文件夹中的提交,以便我们可以构建具有最新提交的单个组件。 How can we achieve the same in Jenkins? 我们如何在詹金斯实现同样的目标?

Ideally all of the components should be a specific repo, however, we don't have the flexibility to break from existing architecture. 理想情况下,所有组件都应该是特定的存储库,但是,我们没有灵活性可以脱离现有架构。

You can solve this using git sparse checkout. 您可以使用git sparse checkout解决此问题。 Under advanced options of git of your job, you can specify what files/folders you want to checkout. 在作业git的高级选项下,您可以指定要检出的文件/文件夹。 Jenkins中的Git稀疏签出

In addition, you also need to make sure your webhooks are set correctly, for automatic triggering of builds. 此外,您还需要确保正确设置了Webhook,以自动触发构建。 which i assume you already have them configured. 我假设您已经配置了它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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