更改 TFS 构建的位置
我有一个 TFS 构建服务器,其中发生 CI 和发布构建。 构建过程在某个域帐户下运行,所有构建活动都发生在该用户的临时目录下。 不幸的是,\Users 目录位于 C: 驱动器上,但事实证明该驱动器没有太多空间。 尽管构建保留策略相当严格,但配置了足够多的构建,这个空间已经变得相当稀缺。
机器上还有其他卷有足够的空间。
任何人都可以建议一种简单的方法来更改根构建目录吗? 到目前为止,我一直在寻找 TFS 财产,但没有取得太大成功。
谢谢。
I have a TFS Build Server where the CI and Release builds occur. The build process runs under some domain account and all the build activity happens under this user's temp directory. Unfortunately, the \Users directory is on the C: drive which turns out to have not much space. Although the build retention policy is quite strict, there are enough builds configured that this space has become quite scarce.
There are other volumes on the machine that have plenty of space.
Can anyone suggest a straightforward way to change the root build directory? I've looked for a TFS property without much success so far.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
对于 TFS 2008,右键单击“构建”节点并选择“管理构建代理”。 选择所需的代理,然后按“编辑...”并更改工作目录。 我个人的偏好是将其更改为以下内容:
c:\bw\$(BuildDefinitionId)
因为这将为您的构建提供一个简短的工作文件夹(.NET API 对文件路径有 260 个字符的限制,因此使用尽可能少的这些字符尽可能适合您的工作文件夹,让您在构建过程中可以更多地使用)。
对于 TFS 2005,编辑相关构建的 TFSBuild.proj 文件,并将工作属性更改为指向每个构建所需的位置。
希望有帮助,
马丁。
For TFS 2008 right click on the Builds node and chose "Manage Build Agents". Select the agent of choice and then press "Edit..." and change the working directory. My personal preference is to change it to something like:
c:\bw\$(BuildDefinitionId)
As that will give it a short working folder for your builds (the .NET API's have a 260 character limit for file paths so using as few of those characters as possible for your working folder gives you mor eto play with during your build).
For TFS 2005 edit the TFSBuild.proj file of the relevant build(s) and change the working property to point to where you want it for each build.
Hope that helps,
Martin.
在团队资源管理器视图中,
右键单击“构建”->“ 管理构建代理,
选择构建代理并点击“编辑...”
将“工作目录”设置为
这适用于使用该构建代理的所有项目。
In Team Explorer View,
Right-click Builds -> Manage Build Agents,
Select the build agent and hit 'Edit...'
Set 'Working directory' to
<New Build Root>\$(BuildDefinitionPath)
This works for all projects using that build agent.
我的 TFS proj 文件有一个名为 BuildDirectoryPath 的属性,
这是放置我的所有源代码以及构建二进制文件的位置。
My TFS proj files have a property called BuildDirectoryPath
This is where all of my source code gets put and where the binaries are built.
为 VS2012 / TFS2012 Server 提供答案。
这将逐个代理更新工作目录
- 团队资源管理器窗口
- 单击构建
- 单击“操作”并选择“管理构建控制器”
- 对于每个代理,单击“属性”,然后单击工作目录字段并进行更改,完成后单击“确定”
注意:OP 谈到了域帐户和临时文件夹。 因此,此解决方案可能不适用于 OP,但在我的情况下确实可以从系统 (C) 驱动器移动到替代卷(在我们的情况下为 D)。
Providing an answer for VS2012 / TFS2012 Server.
This will update the working directory on an agent-by-agent basis
- Team Explorer window
- Click Builds
- Click Actions and select Manage Build Controllers
- For each Agent, click Properties and click inside the working directory field and change it, clicking OK when you are done
Note: the OP talked about a domain account and the temp folder. Therefore, this solution may not work for the OP but it did work in my case to move from the System (C) drive to an alternative volume (D in our case).