I have a build pipeline on VSTS (aka Azure DevOps, as it is known for now) that runs on an agent pool with 2 build agents (agent A and B), with continuous integration set up. I would like to disable simultaneous execution of this build pipeline on different agents, i.e. if there is a build running on agent A, I do not want a build to start running on agent B until the one on agent A is completed.
I can do this by changing the demands to disqualify all but one of the build agents from running the build (e.g. so that only agent A meets the demand). However, this is undesirable as the build agents are shared with other projects, and sometimes the chosen agent would be quite busy, so I do not want to limit the build agent to any specific machine.
Is there a simple way to do this in VSTS?
Login to your Azure DevOps organization. Click on your profile menu at the top right corner, and select Preview features. Use slider to enable or disable multi-stage pipelines feature.
In my case, the pipeline is called Build, and I will click on the pipeline's options and click on Settings on the right corner, as shown in the screenshot below. I will set the “Processing of new run requests” from the options page to disabled. This action will stop new builds from being triggered by commits requests.
In Azure Pipelines, you can run parallel jobs on Microsoft-hosted infrastructure or your own (self-hosted) infrastructure. Each parallel job allows you to run a single job at a time in your organization. You do not need to pay for parallel jobs if you are using an on-premises server.
Navigate to your team project on Azure DevOps. Navigate to Pipelines | Pipelines. Not to have two pipelines triggered later in the lab, disable the CI trigger for the template created pipeline (uncheck) and Save.
You can use the 'Batch changes while a build is in progress' settings on the trigger page of the build definitions. Docs here: https://docs.microsoft.com/en-us/azure/devops/pipelines/build/triggers?view=azure-devops&tabs=yaml
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With