如何在Azure devops管道池中要求多个代理计算机? [英] How to demand multiple agent machines in Azure devops pipeline pool?
问题描述
我在寻找是否可以在代理池"需求中指定代理列表?在用户界面中,天蓝色管道只有两个选项等于和存在.因此,我尝试添加两个需求,但管道仅接受第一个需求
yaml中的相同内容如下
池:名称:AWS Pool需要:-Agent.Name-等于simLin02-Agent.Name-等于ubuAgent01
我想知道是否有某种逻辑方法可以指定yaml中的代理机器列表,例如以下或其他任何我可以传递代理名称列表的方法(特定的代理名称,因为不是池中的所有代理都具有所需的能力)供管道选择.
池:名称:AWS Pool需要:-Agent.Name -in(simLin02,ubuAgent01)
对不起,但是据我所知,Azure Devops不支持使用上述逻辑方法指定代理计算机列表.相反,我们可以定义
例如:如果我们为代理 simLin02
和 ubuAgent01
定义了一种称为 RunTest
的自定义功能,那么我们可以轻松地使用类似的东西来选择包含这两个代理的列表:
池:名称:默认要求:RunTest
由于只有代理 simLin02
和 ubuAgent01
包含 RunTest
功能,因此它将选择其中一个来运行管道.它实际上具有与不支持语法的-Agent.Name -in(simLin02,ubuAgent01)
相同的效果.
I'm looking if I can specify a list of agents in Agent pool demands? In UI azure pipeline has only two options equals and exists. So, I tried adding two demands but pipeline takes only first demand
The same in yaml is as follows,
pool:
name: AWS Pool
demands:
- Agent.Name -equals simLin02
- Agent.Name -equals ubuAgent01
I would like to know if there is any logical way of specifying the list of agent machines in yaml like following or any other alternatives where I can pass a list of agent names(specific agent names because not all agents in the pool have desired capability) for the pipeline to choose from.
pool:
name: AWS Pool
demands:
- Agent.Name -in (simLin02, ubuAgent01)
Sorry but as I know Azure Devops doesn't support specifying the list of agent machines using the logical way above. Instead we can define user-defined capabilities if we want to pass a list of agents for the pipeline to choose from. See:
For example: If we define one custom capability called RunTest
for agents simLin02
and ubuAgent01
, then we can easily use something like this to choose the list which contains these two agents:
pool:
name: Default
demands: RunTest
Since only agents simLin02
and ubuAgent01
contain the RunTest
capability, it will pick one of them to run the pipeline. It actually has same effect like - Agent.Name -in (simLin02, ubuAgent01)
whose syntax is not supported.
这篇关于如何在Azure devops管道池中要求多个代理计算机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!