Not trigger new build on check-in - TFS Build version of ExclusionFilters

· November 18, 2008

OK - today we found out why we are building 650 builds each week…

As part of our build process, we are checking out (and in) a version-file and a SolutionInfo-file. The problem, however, lies in that we have a build trigger that starts a build on each new check-in. So each build triggers a new build that triggers a build that … you get the picture.

I have created build processes before with the great build server CruiseControl. In CruiseControl you have a configuration option called ExclusionFilter that solves this problem. You can tell CruiseControl not to trigger builds from certain users/files.

This option is not available for us TFS Build users. But there is still a way around this. It’s a bit of a hack and is described here.

The solution is to set a certain check-in comment for your check-ins that shouldn’t trigger a new build. The comment is even a MSBuild variable called $(NoCICheckinComment).

So here is a check-in that doesn’t trigger a new build:

<Exec WorkingDirectory="$(CurrentSolutionRoot)" Command="$(TF) checkin /comment:&quot;New Version: $(Major).$(Minor).$(Build).$(Revision) $(NoCICheckinComment) &quot; /recursive Version.txt SolutionInfo.vb" />

Twitter, Facebook