0

I have a scenario where I would like a build to start running on one agent (Job 1), and then after doing some work, I'd like it to run a step on a special agent (pool) of machines with specially licensed software. (Job 2). When that is done I'd like the rest of the build to complete on the original agent (Job 3).

I have been able to use "Variable Tools for Azure DevOps Services" to successfully pass any number of variables between agent jobs, even when they are running on different machines. It is no problem for me to pass a UNC path from Job1 to Job2 / Job3, etc.

However, what I am seeing is that no matter what I do, agent jobs are always running in parallel, and there is no way to get them to run serially, unless they are locked to the same agent on the same machine, which defeats the whole purpose.

Does anyone know of a means to accomplish this? Right now in tests, I have to use "Start-Sleep" or something similar, and repeatedly monitor an external event. A terribly inelegant work-around.

SteveSims
  • 535
  • 6
  • 19

2 Answers2

0

I found the answer. A job properties contains a field called "dependencies". You can make it serial by setting a dependency on the previous job.

SteveSims
  • 535
  • 6
  • 19
0

In Azure Devops for the agent job you will get below options

enter image description here

You can select any option based on your requirements.

Sandesh A D
  • 162
  • 2
  • 12
  • Good information. Actually though that choice is the default one, and I always had that set, and believe it or not without the dependencies checked (see below), the jobs _still_ run in parallel. – SteveSims Jan 03 '20 at 14:04
  • Are you using multi-agent option? – Sandesh A D Jan 03 '20 at 15:03
  • I tried most all combinations. Generally no. I considered and tried using Multi-Agent = 1, Multi-Agent = 0 (not allowed option). The multi-agent thing did not have an effect, probably because I had a demand on Job 2 for a separate agent. – SteveSims Jan 05 '20 at 00:03