4

I have a an Azure Pipeline A, that executes a deployment to my Salesforce org in the event of a PR merge.

My problem statement is,

I am not able to restrict the execution of this pipeline such that it executes only after the previous execution of the same pipeline has completed.

In other words, if this pipeline is triggered by multiple PR's, then I would want only once instance of the pipeline to run. The next one should wait until the previous run has been completed.

Is there a way to achieve this?

B.T Anand
  • 549
  • 1
  • 13
  • 26
  • Hi, friend. How about Fairoz's solution? Does it work for your case? If yes, you can accept the answer. But, if you still facing any issues, feel free to leave comment here :-) – Mengdi Liang Oct 24 '19 at 10:22

2 Answers2

4

You can enable "Batch changes while a build is in progress" option to execute one pipeline at a time. enter image description here If your question was on Release Pipeline, you can achieve this through specifying number of executions in the "Deployment queue settings" under Pre-Deployment conditions for the particular stage.

enter image description here

Fairoz
  • 828
  • 2
  • 8
  • 21
3

If you are using YAML you should be able to use the following trigger:

trigger:
  batch: boolean # batch changes if true; start a new build for every push if false (default)

https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema%2Cparameter-schema#triggers

cal5barton
  • 1,606
  • 1
  • 14
  • 29