问题描述
我已经设置了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.
尽管已经有人提出使用SVN提交后钩子的建议,但在Hudson/Jenkins中我找不到关于此功能的信息.也许是如此简单,以至于每个人(除了我之外)都知道该怎么做!
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上次构建以来,如何获取已更改文件的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!