2
votes

I have installed TFS 2015 Update 3. And created an agent pool called "HYB Pool". This agent pool has 2 agents in it. One is a Linux agent and other one is a windows agent. The reason it was created this way was because "building the code" step is using windows agent and post build steps (using docker to build and push images) is using Linux agent.

When I execute only build step in HYB Pool it works fine. And again when I execute only post build step (which requires linux agent) with HYB Pool, it works well. But when I combine all the steps together and execute it in HYB Pool then it throws following error:

No agent found in pool 6 which satisfies the specified demands:

  • sh
  • DotNetFramework
  • Agent.Version > Version 1.94.0

How do I fix this? Looks like agents have capabilities but when the whole process is combined (build and docker step) it is giving out error.

Agent version for

  • linux agent is 2.104.1
  • windows agent is 1.95.3
1
Agents have capabilities of sh and DotNetFramework. I can see following in capabilities: sh=/bin/sh and DotNetFramework=C:\Windows\Microsoft.NET\Framework64\v4.0.30319Raji

1 Answers

2
votes

The whole build process must be executed by a single agent. And the single agent must have all the capabilities the build demands.

To solve this you'll have to:

  • remote ssh from your windows agent to a linux machine to execute the other steps. You can use a custom batch or powershell step to implement the remote script parts.
  • or perform the .NET steps on the linux host (which could work if you're able to use Mono or .NET Core to perform the build process
  • or perform the compile & build steps in the build and then pick up the artifacts in the Release management part of TFS, where each stage is executed by a single agent. So your first stage could pick up the build results from the list of artifacts of the build and perform the steps to build the Docker images and store them somewhere or register them in your docker repository.
  • Possibly upgrade your build agent to Windows 10 Anniversary edition and enable the Linux shell. That will solve the demand issue, but will likely not help you really build your docker images on linux.