Question

In TFS 2010, I am looking for a way to have multiple build definitions that all build in the same agent folder. The reason for this is that I am trying to implement Gated Checkin but do not want to have to build the entire branch every time so I have created multiple builds that only build a subset of the solutions/projects.

Example Branch:

MyBranch:

- Folder1
 * Solution1A
 * Solution1B
- Folder2
 * Solution2A
 * Solution2B

Example Build Definitions:

 - MyBranchBuild - builds all solutions in all folders
 - MyBranchFolder1Build - builds all solutions under Folder1
 - MyBranchFolder2Build - builds all solutions under Folder2

Example Build Agents:

 - GateAgent1
  * Builds in C:\GateAgent1\MyBranch
 - GateAgent2
  * Builds in C:\GateAgent2\MyBranch

Currently MyBranchBuild contains in the Workspace definition "Build Agent Folder":
 - $(BuildDir)\Folder1
 - $(BuildDir)\Folder2

MyBranchFolder1Build and MyBranchFolder2Build only contain workspace mappings for their intended folders.

GateAgent1 & 2 use variations on the below working directory:

C:\GateAgent1\$(BuildDefinitionPath)

My resulting builds are going to

- C:\GateAgent1\MyBranchBuild
 - C:\GateAgent1\MyBranchFolder1Build
 - C:\GateAgent1\MyBranchFolder2Build

Again, my goal is for all 3 to build under:

- C:\GateAgent1\MyBranch
Était-ce utile?

La solution 2

Figured it out.

  • Build Definition->Build Agent Folder = $(SourceDir)\MyBranch\Folder1
  • Build Agent Properties->Working Directory = C:\GateAgent1

Autres conseils

Instead of $(BuildDefinitionPath) property, you can specify the hard-coded branch name in working directory under Agent properties.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top