Jenkinsfile - agent matching multiple labels

放肆的年华 提交于 2019-12-08 08:07:40

问题


In my declarative pipeline, i need to select a node matching 2 labels. I tried something like this

agent { label 'label1 && label2'}

But i get an error that there are no nodes. I have a node with 2 labels label1 and label2 associated.

Started by user admin
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] node
Still waiting to schedule task
There are no nodes with the label ‘label1&&label2’

I know that i could temportailiy fix this by creating a 3rd label label1-2 and associate it with agent in the pipeline.

Is there any proper way to fix this?


回答1:


Ok..figured it out.

agent {label "label1" && "label2"}


来源:https://stackoverflow.com/questions/51233642/jenkinsfile-agent-matching-multiple-labels

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!