Search code examples
parallel-builds

can we select specific build agents for different configuration's(Release or Debug) for parallel builds


I am using Parallel Template(from Jim Lamb's Blog) to run builds for two configuration

  1. one for "Release"
  2. second for "Debug"

I have two agents on my controller. Every time I run this build it selects for the available agent from the controller and randomly selects the agents for the two builds. Sometimes "Release" run on Agent 1 and "Debug" on Agent 2 and sometimes "Debug" runs on Agent 1 and "Release" on Agent 2.

I want to control this activity.

Is there a way to choose specific agents for the two configurations...??? for example.... Suppose I have a controller(Controller 1) with two agents(Agent 1 and Agent 2).

I want to select Agent 1 for "Release" configuration and Agent 2 for "Debug" configuration.


Solution

  • When we provide the Name Filter = Default agent. It takes whichever agent is available and continue with that agent. If we want to choose any specific agent we can use a simple assign activity just after get the build agent to choose the specific build agent as used below.

    agentsettings.name= "Agent name".

    This will let us choose the build agent that we wanted it to perform the task.