How to tweak TFS to select the build agent for smallest possible incremental build

61 Views Asked by At

Assume a TFS incremental build definition and build agents BA1 and BA2. Assume that the last two executed builds were for commit C1 in branch BR1 on build agent BA1 and for commit C2 in branch BR2 on build agent BA2. Assume that the difference between BR1 and BR2 is large.

Now a new build is requested for commit C3 in branch BR2. Typically sizeof(C3-C2) << sizeof(C3-C1). So to get the smallest amount of recompilations the build should be executed by the build agent that built C2, i.e. by build agent BA2.

Unfortunately this is not how TFS selects build agents. Is it possible to tweak the TFS build agent selection as described above?

1

There are 1 best solutions below

3
On

If you mean only get the new added/changed sources and build with the specific agent for the next build, then try below things:

  1. Make sure the Clean option is disabled (Clean set to false in Get sources step). Please see Clean the local repo on the agent for details.
  2. Set Demands for your build definition, please see How to send TFS build to a specific agent or server enter image description here