开发者

Can't get SVN exclusions in Hudson to work

Assuming the Hudson job checks out 2 SVN directories:

https://foo.com/packages (root is https://foo.com/packages) -> "packages" in workspace
https://bar.com/temp/Hudson (root is https://bar.com/temp) -> "Hudson" in workspace

I tried different things, browsed online for answers, but I开发者_开发知识库 still can't get these 2 things to work:

1) Prevent any commit in "Hudson" from triggering a build: I tried several path combinations in "Excluded Regions" without success.

2) Prevent any commit containing "CR:" in the message from triggering a build: I tried "\bCR:\b" and others in the "Excluded Commit Messages" field, but it doesn't work.

Thanks!


The regex must completely match the path that is being excluded. It cannot be just the name of the directory. Additionally, it must also include a leading slash.

For example, say a build commits libraries and that commit should not trigger another build.

Location of the directory in SVN:

http://subversion.xyz.com/MyProject/lib

What goes in the Exclude Regions box:

/MyProject/lib/.*


Why not try the other direction? Write a hook script in SVN that calls Hudson only when needed. For commits coming from Hudson, don't trigger a build at all.


1-1) An easy, but kind of dirty way is, to have two jobs, the first one detects the changes in one of your repositories and triggers the second job. The second job downloads all sources that are needed and runs the build.

Pro: easy to understand, not much fiddling around. cons: you either have to checkout from one repository twice or find an reliable way to copy the sources from job1 to job2 (e.g. Clone Workspace SCM), two jobs

1-2) Configure one Repository in Hudson and check the sources out from the second repository in the first build step.

Pro: one job, easy solution con: you might need to hard code passwords, misses the beauty of using the Hudson support for subversion.

2) \bCR:\b doesn't look like a regular expression. I would suggest you try something like .*CR:.* and if CR: has to be at the beginning of the line ^CR.*

This page about regular expressions helped me to dive deeper into regular expressions but it also contains a beginners guide.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜