在自定义生成任务中获取TFS标签的值 [英] Get the value of the TFS label in custom build task

查看:87
本文介绍了在自定义生成任务中获取TFS标签的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我们目前正在使用TFS 2017.1上的正版,并且正在寻找一种方法来跟踪我们的构建输出和TFS源代码标签。


典型的情况是客户ABC在"产品A版本2.5.1234.0"中发现了错误。我们不能轻易地将该产品版本追溯到TFS源代码标签。为此,我们想将TFS源代码标签添加为标记为构建输出的meta
数据。


我们可以设置一个将应用于源代码的标签通过定义标签来在构建中使用,例如:   ProductA_2.5。$(Build.BuildNumber).0



我们有一个自定义构建任务,可以将元数据应用到我们的构建二进制文件(msi,msm,exe,dlls等)。


我们想要实现的是将TFS标签的值添加到构建二进制文件中。


我们主要关注的是如何在我们的托管任务中获得应用于源代码的tha标签的价值。是否有一个特殊的变量名称,我们可以用它来检索标签值,或者你有任何其他建议如何实现这一点。


最好的问候


Niklas


解决方案

Hi Niklas,


感谢您发布此处。


实际上,您可以标记来源构建定义(Repository选项卡),您可以将
标签格式设置为


(build.buildNumber)或任何其他已定义的变量但不指定其他字符。


因此,标签将在构建完成后自动创建。


您可以在产品发生故障后相应地跟踪代码,并且可以使用变量获取该标签的值,例如


(build.buildNumber)。


最好的问候。

Hi all,

we're currently using on prem TFS 2017.1 and are looking for a way to trace our build outputs to a TFS source code label.

The typical case is that customer ABC has found an error in "Product A version 2.5.1234.0". We wan't to easily be able to trace that Product version back to a TFS source code label. To do this we would like to add the TFS source code label as meta data stamped into our build outputs.

We can setup a label that will be applied to the source code that is used in the build by defining a label such as:  ProductA_2.5.$(Build.BuildNumber).0

We have a custom build task that can apply meta-data to our build binaries (msi, msm, exe, dlls etc).

What we would like to accomplish is to add the value of the TFS label to our build binaries.

Our main concern is how do we get the value of tha label being applied to the source code in our custumized task. Is there a special variable name we can use to retrive the label value or do you have any other recommendations on how to accomplish this.

Best Regards

Niklas

解决方案

Hi Niklas,

Thank you for posting here.

Actually, you can label sources in build definition (Repository tab), you can set the Label format as


(build.buildNumber) or any other defined variables but not specify other characters.

Thus, the label will be created automatically once the build complete.

You can trace the code accordingly once the product fail, and you can get the value of that label using the variable, eg


(build.buildNumber).

Best Regards.


这篇关于在自定义生成任务中获取TFS标签的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆