tags:

views:

33

answers:

2

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!

A: 

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.

AngerClown
Good point, that would likely work, but 1) I don't have admin rights on the repo and 2) SVN shouldn't have to know about or deal with the build system (these are really separate systems and I'd rather not add more dependencies than necessary).Hudson offers what seems to be a clean solution, I'd like to use it.
Pol
A: 

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.

Peter Schuetze
For #1, again a nice workaround idea, I'll wait a bit more to see if someone can come up with the proper syntax for "Excluded Regions". For #2, I'll try your suggestion.
Pol
Your suggested regex seems to work, all good!
Pol
Try a similar syntax for your excluded regions. According to the examples, you have to use the path from the repository (excluding the repository URL). I added a link for regular expressions to my answer.
Peter Schuetze
For 1-1, you could set up the jobs to share a workspace (now with custom workspace, perhaps one day in an automatic fashion: http://issues.hudson-ci.org/browse/HUDSON-682)
Michael Brewer-Davis
@Michael Brewer-Davis: When you use a shared workspace you need to make sure, that only one of the two jobs runs. You can use the logs and latches plugin for that. I am not comfortable with the idea of two jobs using the same workspace. So my preference is to use the Clone Workspace plugin.
Peter Schuetze