代码之家  ›  专栏  ›  技术社区  ›  KitKarson

Jenkinsfile-代理匹配多个标签

  •  1
  • KitKarson  · 技术社区  · 8 年前

    在我的声明性管道中,我需要选择一个匹配2个标签的节点。 我试过这样的东西

    agent { label 'label1 && label2'}

    但我得到一个错误 there are no nodes . 我有一个有两个标签的节点 label1 label2 相关。

    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’
    

    我知道我可以通过创建第三个标签来暂时解决这个问题。 label1-2 并将其与管道中的代理关联。

    有没有合适的方法来解决这个问题?

    1 回复  |  直到 8 年前
        1
  •  6
  •   KitKarson    8 年前

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