如何仅在特定文件集发生更改时触发构建 [英] How to trigger a build only if changes happen on particular set of files

查看:22
本文介绍了如何仅在特定文件集发生更改时触发构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何告诉 Jenkins/Hudson 仅针对 Git 树中特定项目的更改触发构建?

How do I tell Jenkins/Hudson to trigger a build only for changes on a particular project in my Git tree?

推荐答案

Git 插件有一个选项(排除区域),可以使用正则表达式根据提交中的文件是否与排除区域正则表达式匹配来确定是否跳过构建.

The Git plugin has an option (excluded region) to use regexes to determine whether to skip building based on whether files in the commit match the excluded region regex.

不幸的是,现成的 Git 插件目前 (1.15) 没有包含区域"功能.但是,有人在 GitHub 上发布了补丁,这些补丁适用于 Jenkins 和 Hudson,实现了您想要的功能.

Unfortunately, the stock Git plugin does not have a "included region" feature at this time (1.15). However, someone posted patches on GitHub that work on Jenkins and Hudson that implement the feature you want.

这是一个小小的构建工作,但它可以像宣传的那样工作并且非常有用,因为我的一个 Git 树有多个独立的项目.

It is a little work to build, but it works as advertised and has been extremely useful since one of my Git trees has multiple independent projects.

https://github.com/jenkinsci/git-plugin/pull/49

更新:Git 插件 (1.16) 现在具有包含"区域功能.

Update: The Git plugin (1.16) now has the 'included' region feature.

这篇关于如何仅在特定文件集发生更改时触发构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆