当我的本地PC、源、构建代理和部署都位于单独的服务器上时,如何设置 TFS 构建定义

发布于 2025-01-03 23:18:28 字数 452 浏览 0 评论 0原文

我正在尝试在 TFS 2010 中设置构建定义。此选项似乎非常有限,例如我的源代码管理中有 5 个解决方案文件,但我似乎无法指定使用哪一个。我从我的部署服务器中选择了一个工作区(TF 每 10 分钟获取一次,所以我知道它是一个有效的工作区),但是当构建运行时,它给了我一个错误,抱怨映射 - 这似乎使它成为自己从某处映射。

我设置的映射:$/InteractV4/Dev/IV4ProductionSR/

错误:$/InteractV4/Dev/IV4Support/iv4ProductionSR.sln 没有工作文件夹映射。

有 2 个与此错误有关的问题。 1:这不是我想要使用的工作区。 2:这是错误的,在我的本地电脑和部署电脑上都有该源的工作文件夹映射,但在构建服务器上没有。我是否需要在构建代理服务器上设置大量文件夹和映射?或者在主 TFS(源)服务器上?

谢谢。

I'm trying to set up a build definition in TFS 2010. The options for this seem very limited, for instance I have 5 solution files in my source control and I don't seem to be able to specifiy which one to use. I've selected a workspace from my deployment server (which does a TF get every 10 minutes so I know it's a valid workspace), but when the build runs it gives me an error complaining about the mapping - and it seems to have made it's own mapping up from somewhere.

Mapping I set: $/InteractV4/Dev/IV4ProductionSR/

Error: There is no working folder mapping for $/InteractV4/Dev/IV4Support/iv4ProductionSR.sln.

There are 2 issues with this error. 1: it's not the workspace I was trying to use. 2: It's wrong and there is a working folder mapping for this source, both on my local PC and on the deployment pc, but NOT on the build server. Do I need to set up a load of folders and mappings on the build agent server? Or on the main TFS (source) server?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

挽你眉间 2025-01-10 23:18:28

TFS-Builds 在构建过程中生成的私有工作区上运行,因此在不进行调整的情况下使用自定义工作区是不可能的。

可以通过转到 Build 来阻止 TFS 使用每个 Buid 重新生成新的工作区定义编辑 "Process":"2.Basic":"Clean Workspace" 并将默认值 All 更改为 Outputs

为存在各种对的每个构建定义设置映射:

Source Control Folder   | Build Agent Folder
$/foo/bar               | $(SourceDir)\somewhere

$(SourceDir) 在构建期间被替换,并且它得到其值来自构建代理设置。如果您转到 TFS 管理控制台 &选择“构建配置”,您将看到在服务器上运行的构建代理列表(其他服务器中可能还有其他代理)。单击代理的“属性”,会弹出如下窗口:
在此处输入图像描述
“工作目录”这一条目是解析 & 的条目。在构建期间替换 $(SourceDir)

例如,条目 $(SystemDrive)\Builds\$(BuildAgentId) 可以解析为类似 < code>C:\Builds\88。
因此,对于在此代理上运行的 TFS 构建,您应该期望位于 $/foo/bar 下源代码控制中的所有源可以在下面找到C:\Builds\88\somewhere


编辑
根据您的评论,您现在拥有如下映射:

$\InteractV4\Dev\IV4ProductionSR | $(SourceDir)

您的构建失败,因为“没有工作文件夹映射”对于 $/InteractV4/Dev/IV4Support/iv4ProductionSR.sln"。
此源代码控制目录 $/InteractV4/Dev/IV4Support 是否已映射到您的构建定义中?

TFS-Builds operate on private Workspaces that get generated during the build process, so using a custom-Workspace is without tweaking impossible.

It's possible to keep TFS from regenerating a new Workspace with each Buid, by going to Build Definition edit "Process":"2.Basic":"Clean Workspace" and changing default value All into either Outputs or None.

The mappings are set for each Build Defition where various pairs exist:

Source Control Folder   | Build Agent Folder
$/foo/bar               | $(SourceDir)\somewhere

The $(SourceDir) is substituted during Build and it gets its value from the Build Agent Settings. If you go to the TFS Admin Console & select "Build Configuration", you 'll be presented with a list of Build Agents running on the Server (there might be additional Agents in other Servers). Clicking on "Properties" of an Agent, pops up a Window like that:
enter image description here
This entry "Working directory" is the one that resolves & substitutes $(SourceDir) during build.

For example, an entry $(SystemDrive)\Builds\$(BuildAgentId) could resolve into something like C:\Builds\88.
So, for a TFS Build running on this Agent, you should expect all Sources that stand in source control under $/foo/bar to be found under C:\Builds\88\somewhere


EDIT
According to your comments you have now a mapping like this:

$\InteractV4\Dev\IV4ProductionSR | $(SourceDir)

Your build fails, as "There is no working folder mapping for $/InteractV4/Dev/IV4Support/iv4ProductionSR.sln".
Is this source control directory $/InteractV4/Dev/IV4Support mapped in your Build Definition?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文