Azure Devops-如何防止多个管道同时运行? [英] Azure Devops - How to prevent multiple pipelines run at same time?

查看:68
本文介绍了Azure Devops-如何防止多个管道同时运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个具有3个启用代理的不同管道.我的问题是我的管道之一如果同时运行多个构建失败(因为tets发生冲突),所以我想将一个构建请求排队,如果有另一个针对此特定的运行管道.

I've two different pipelines with 3 enabled agents. My problem is that one of my pipelines fails if has multiple builds running at same time (because tets are running into conflict), so I want to queue an build request if there is another one running for this specific pipeline.

我尝试过的第一件事是使用功能和要求来识别一个代理,因此该管道始终只有一个代理可用,但是它不适用于 Microsoft托管的代理,并且那就是我所拥有的.然后我想也许可以在管道配置中指定创建2个代理池以使用其中之一,但是又一次我不能为 Microsoft托管的代理

The first thing i've tried it's use capabilities and demands to identify one agent, so always has only one agent available to this pipeline, but it doesn't work with Microsoft-hosted agents and that it's what i have. Then I thought that maybe creating 2 agent pools I can specify on my pipeline config to use one of them, but one more time I can't create multiple pools for Microsoft-hosted agents

如何防止多个版本同时运行?

How can I prevent multiple builds running at same time?

谢谢!

推荐答案

最后,我解决了从Build传递到Build + Release的问题.

Finally I resolved my problem passing from Build to Build + Release.

@Fairoz的解决方案对我不起作用,因为仍然允许同时运行不同分支的多版本构建.我需要的是锁定管道,直到没有构建正在运行.在Azure Devops上执行此操作的方法具有功能+需求,但不适用于Microsoft托管的代理,因此我所做的将我所有的测试逻辑迁移到发布到CI的发行版离开只是制造神器的建筑.

The solution of @Fairoz not works for me because still alowing multplie builds of different branches runs at same time. What I need it's to lock an pipeline until there's no builds running. The way to do this on Azure Devops it's with Capabilities + Demands, but not works with Microsoft-hosted agents, so what I made i'ts move all my tests logic to an Release that deploys to CI and leave the build that just make an Artifact.

因此,工作流程为: PR至Github>触发构建>通过我的分支生成工件>触发发布>向CI发布代码并运行测试

Azure Devops可以控制一个Stage可以存在多少个并行执行,所以我将并行任务的数量限制为1,就是这样

Azure Devops allow to control how many parallel executions of one Stage can exists, so I limited to 1 the number of parallel tasks and that's it

这篇关于Azure Devops-如何防止多个管道同时运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆