happiness is a warm gun
Creative Commons License photo credit: badjonni

UPDATE (April 1st 2009): no, it’s not an April fool’s joke… The fun continues with the new version of CCNet… read the update below

After about two hours of exercises in futility I finally managed to persuade CruiseControl.NET to start the build when a particular file on the disk changes. I was just about ready to give up and start implementing my own CI software before the following configuration managed to do what I wanted:

<sourcecontrol type="filtered">
    <sourceControlProvider type="filesystem">
        <repositoryRoot>C:\Temp\</repositoryRoot>
    </sourceControlProvider>
    <inclusionFilters>
        <pathFilter>
            <pattern>**/CopyAndRun.bat</pattern>
        </pathFilter>
    </inclusionFilters>
</sourcecontrol>

Notice the <pathFilter> tag? I have no idea why only this particular filter value works. The file path I wanted to cover is C:\Temp\CopyAndRun.bat. I tried several other (and more logical) filter values, like:

  • CopyAndRun.bat
  • /CopyAndRun.bat
  • \CopyAndRun.bat
  • C:\Temp\CopyAndRun.bat

… and some others, but to no avail, CCNet reported that none of the modified files matched the specified filter. Needless to say I couldn’t find any relevant documentation and samples for this situation.

I’m more and more of the opinion that CCNet, although powerful and flexible, is pretty horrible for configuring and maintaining. Maybe it’s really time for me to start working on my own solution. Well, to be honest, I’ve already made first steps

UPDATE (April 1st 2009): it turns out the new v1.4.3 version decided to do it differently… and breaks the existing behavior, again in an untraceable way. The configuration block I posted above doesn’t work anymore, the new configuration now looks like this:

<sourcecontrol type="filtered">
    <sourceControlProvider type="filesystem">
        <repositoryRoot>C:\Temp</repositoryRoot>
    </sourceControlProvider>
    <inclusionFilters>
        <pathFilter>
            <pattern>CopyAndRun.bat</pattern>
        </pathFilter>
    </inclusionFilters>
</sourcecontrol>

Changes:

  • repositoryRoot now must not have a trailing backslash
  • pattern now works without the ** wildcard.

Again, it is very hard to determine the right configuration. The only help (if it is help at all) is the CCNet service log file, but it doesn’t really tell you why a particular file does not match the filter critieria. Urghhhhh…