简体   繁体   English

如何通过标签在TFS 2010中进行自动构建

[英]How to do an Automated build in TFS 2010 by a label

I have my automated builds working but I want to be able to go back to a specifc labeled version and build from that source. 我的自动构建工作正常,但我希望能够返回到特定标签版本并从该源构建。 The build definition under "Process" has the item "Get Version" but this is for a specific changeset which seems fairly useless. “Process”下的构建定义具有“获取版本”项,但这是针对特定变更集的,这似乎相当无用。 Does anyone have any idea how I would go about doing this? 有谁知道我会怎么做呢?

The Get Version accepts what TFS calls an versionspec which can be either a changeset or a label. Get Version接受TFS调用的版本规范,可以是变更集或标签。 To specify a label just prefix it with an L. 要指定标签,只需在其前面加上L.

LMyLabel LMyLabel

@Dylan Smith: Is right. @Dylan Smith:是对的。 You can specify in the advanced Get Version parameter the label by: LmyLabel or CmyChangeset in order to queue a specific version. 您可以在高级Get Version参数中指定标签:LmyLabel或CmyChangeset,以便对特定版本进行排队。 There are other options like date, "W" (Version last fetched to your workspace), or "T" (latest version) as well. 还有其他选项,如日期,“W”(最后提取到工作区的版本)或“T”(最新版本)。

For more information: Building a Specific Version with Team Build 2008 有关更多信息: 使用Team Build 2008构建特定版本

During your build process, label the code (In my case I use the build number as part of the label). 在构建过程中,标记代码(在我的情况下,我使用内部版本号作为标签的一部分)。

Then when you want to build a specific labeled version, pass the label to the build script, get the code from the library by label, build the code, and deploy. 然后,当您想要构建特定的标签版本时,将标签传递给构建脚本,按标签从库中获取代码,构建代码并进行部署。

See http://msdn.microsoft.com/en-us/library/fx7sdeyf.aspx for how to get a labeled version. 有关如何获得带标签的版本,请参见http://msdn.microsoft.com/en-us/library/fx7sdeyf.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM