如何获取自上次在 Jenkins/Hudson 中构建以来已更改文件的列表 [英] How to get list of changed files since last build in Jenkins/Hudson

查看:34
本文介绍了如何获取自上次在 Jenkins/Hudson 中构建以来已更改文件的列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了 Jenkins,但我想了解在当前构建和之前构建之间添加/更改了哪些文件.我想根据源代码树的某些部分是否发生更改来运行一些长时间运行的测试.

I have set up Jenkins, but I would like to find out what files were added/changed between the current build and the previous build. I'd like to run some long running tests depending on whether or not certain parts of the source tree were changed.

在网上搜索后,我发现 Hudson/Jenkins 中没有提到这种能力,尽管有人建议使用 SVN 提交后挂钩.可能就是这么简单,大家(除了我)都知道怎么做吧!

Having scoured the Internet I can find no mention of this ability within Hudson/Jenkins though suggestions were made to use SVN post-commit hooks. Maybe it's so simple that everyone (except me) knows how to do it!

这可能吗?

推荐答案

如果您轮询更改并使用 SVN 更新,CI 服务器将显示更改列表.但是,您似乎希望根据修改的文件来更改构建的行为.我认为单独使用 Jenkins 没有任何开箱即用的方法.

The CI server will show you the list of changes, if you are polling for changes and using SVN update. However, you seem to want to be changing the behaviour of the build depending on which files were modified. I don't think there is any out-of-the-box way to do that with Jenkins alone.

提交后挂钩是一个合理的想法.您可以对作业进行参数化,并让您的挂钩脚本使用根据提交的更改设置的参数值启动构建.我不确定这对你来说有多困难.

A post-commit hook is a reasonable idea. You could parameterize the job, and have your hook script launch the build with the parameter value set according to the changes committed. I'm not sure how difficult that might be for you.

但是,您可能需要考虑将其拆分为两个单独的作业 - 一个在每次提交时运行,一个单独的用于您并不总是需要的长时间运行的测试.我个人更喜欢在执行之间保持工作行为的一致性.否则,可追溯性就会受到影响.

However, you may want to consider splitting this into two separate jobs - one that runs on every commit, and a separate one for the long-running tests that you don't always need. Personally I prefer to keep job behaviour consistent between executions. Otherwise traceability suffers.

这篇关于如何获取自上次在 Jenkins/Hudson 中构建以来已更改文件的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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