Search code examples
tfstfsbuildtfs-2015

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


How can I add a capability to a build agent in 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.

I know that I can add this capability manually, through the web interface, but how to do it with a script?

I've read that TSF2015 discovers build agent capabilities alone, but.. how to instruct it about 'how to detect my build tool' ?

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


Solution

  • Credits go to Donovan Brown and its blog post

    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

    According to a GitHub issue, this functionality will eventually appear in npm scripts accompanying vso-build-tasks.