Reputation: 6173
I have few builds defined in the TFS project and I want to trigger these builds on our build servers. The problem is that build servers has different drive letters used for DVD drive. The first build server has DVD drive letter set to D drive, 2nd build server has DVD drive letter set to E drive. My build definition's workspace mappings are set to "E:\Builds" folder for building on the 1st build server and other build definition's workspace mappings are set to "D:\Builds" folder to build on the 2nd build server.
I always have to change build definition's workspace mappings when I want to use different build server.
Is it possible to use environmental variable for workspace mappings? I can create BUILDS_ROOT environment variable on both servers to set correct builds location on both servers.
I want to have build definition workspaces independent on build server's drive letters and paths. Is it possible to do it somehow?
Normally the simplest solution can be reassigning drive letters to be the same on both servers, but this is not so easy because there are some software already installed on both drives.
Upvotes: 1
Views: 2170
Reputation: 1817
If you're talking about the builds on the Agents then you should try using $(SystemDrive)\Builds...
in the Working Directory on the Agent. Each Agent can build on whatever drive it has (or you can change this to whatever you like).
In the build mappings (Workspace in the Build Definition) set these to $(SourceDir)\solutionfoldernameetc
, you'd only set these to hard coded paths with drives in your own/developer workspaces.
Upvotes: 0
Reputation: 3596
You should not have any problem if you use $(SourceDir) variable in your build definition working folder mappings.
See this forum post for more details.
Upvotes: 2