简体   繁体   English

如何自动添加(或让tfs2015发现)构建代理功能?

[英]How to automatically add (or let tfs2015 discover) build agent capabilities?

How can I add a capability to a build agent in TFS 2015? 如何在TFS 2015中为构建代理添加功能?

For example, I would like to install a build tool (on a TFS2015 build agent) and register this as a TFS Build agent capability. 例如,我想安装一个构建工具(在TFS2015构建代理上)并将其注册为TFS构建代理功能。

I know that I can add this capability manually, through the web interface, but how to do it with a script? 我知道我可以通过Web界面手动添加此功能,但如何使用脚本执行此操作?

I've read that TSF2015 discovers build agent capabilities alone, but.. how to instruct it about 'how to detect my build tool' ? 我已经读过TSF2015单独发现构建代理功能,但是......如何指导它“如何检测我的构建工具”?

References 参考

I've read so far: 我到目前为止读过:

http://nakedalm.com/using-build-vnext-capabilities-demands-system/ http://www.colinsalmcorner.com/post/why-you-should-switch-to-build-vnext http://nakedalm.com/using-build-vnext-capabilities-demands-system/ http://www.colinsalmcorner.com/post/why-you-should-switch-to-build-vnext

Credits go to Donovan Brown and its blog post 积分转到Donovan Brown 及其博客文章

I have tried the solution it proposes, and it works in my scenario/environment: 我尝试过它提出的解决方案,它适用于我的场景/环境:

  1. set an environment variable during the software setup 在软件设置期间设置环境变量
  2. this variable and its value will appear as agent capabilities in the TFS agent resume 此变量及其值将在TFS代理程序恢复中显示为代理程序功能

According to a GitHub issue , this functionality will eventually appear in npm scripts accompanying vso-build-tasks. 根据GitHub问题 ,此功能最终将出现在伴随vso-build-tasks的npm脚本中。

In the Agent capabilities you can define custom "user capabilities" I added a custom user capability called 在代理功能中,您可以定义自定义“用户功能”,我添加了一个名为的自定义用户功能

  • "Tag" and set it to VS2015 “标记”并将其设置为VS2015

In my build definition under General, under Demands, I added a demand that 在General下的我的构建定义中,在Demands下,我添加了一个需求

  • "Tag" equals VS2015 “标签”等于VS2015

This will now force my build to that specific Pool (or agent) 这将强制我的构建到特定池(或代理)

For example I installed a 3rd Party utility to one of my build agents and added to the Agent user capabilities "AutoIt" = True. 例如,我为我的一个构建代理安装了第三方实用程序,并添加到代理用户功能“AutoIt”= True。 In my build, under General, Demands, I added one called "AutoIt" exists, this forces this build to the agent with the 3rd party utility that is installed. 在我的构建中,在General,Demands下,我添加了一个名为“AutoIt”的存在,这会强制将此构建添加到已安装的第三方实用程序的代理程序中。

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

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