Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
232 views
in Technique[技术] by (71.8m points)

Azure Devops - is it possible to queue stages between pipeline runs

I have a Azure Devops pipeline (yml) with a stage that deploys an application to an environment and then runs a bunch of tests against it. This pipeline is triggered when a PR is created. We sometimes have multiple runs of the same pipelines happening at once resulting in two deployments to the same environment happening at the same time.

Is it possible to configure the pipeline in such a way that the deploy stage can only be executed one at a time?


Simple example of what I'm trying to do:

Pipeline (yml) with stages: 1) Build -> 2) Deploy/Test -> 3) Release

Run 1: Build: complete -> Deploy/Test In progress -> Release waiting for stage 2

Run 2: Build: complete -> Deploy/Test waiting for Run 1 stage 2

question from:https://stackoverflow.com/questions/65920779/azure-devops-is-it-possible-to-queue-stages-between-pipeline-runs

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

If you use YAML then make you release in deployment job where you use environment with enabled exclusive lock. However, this has some drawback:

enter image description here

On developer community you can find a feature request for better handling this. And there is one workaround which involved calling REST API. But, as someone already mentioned:

Workarounds involving polling end up with race conditions where two queued builds can both end up starting.

So there is no ideal solution, but if you can please upvote above mentioned request.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...