Tutorial :When a TFS build is triggered by a check-in what how does it do the get?



Question:

I have a CI process set up in TFS 2008 so that every time a check-in happens a build is triggered but only if a build is not already running. The exact setting used in the configuration is the radio button labeled:

"Accumulate check-ins until the prior build finishes (fewer builds)" The checkbox "Build no more than every ___ minutes." is not checked

I have other build processes that might also be going on so I can see that a build is queued with a specific "Date Queued". When the build server gets to the queued build, let's say that it takes 10 minutes to get there, does it use the time-stamp of the queued build to do a get or does the build do a "get latest"?


Solution:1

I believe TFS will use the changeset of the last triggering commit (i.e. the build does a 'get specific version' by changeset ID, rather than a 'get latest').

You can check this by looking at the build report and finding the value for the 'Source control version' field, you should see something similar to this:

TFS Build Report Fragment, Source control version field http://i47.tinypic.com/a3ihhs.png

So first off, I would check that the value you're seeing for this is consistent with what you see in the build's workspace and that the build is referencing the expected changeset.

Assuming that your build is working as advertised (and this is a problem for you), then you may want to consider altering this default behaviour and force your CI build do a 'get latest' by overriding the 'GetVersion' MSBuild property in the build's TFSBuild.rsp file, by adding the following:

/p:GetVersion=T  

Where 'T' stands for 'tip' (or 'head' in SVN parlance).


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »