美文网首页
jenkins pipeline 声明式agent动态设置代理标

jenkins pipeline 声明式agent动态设置代理标

作者: _fishman | 来源:发表于2020-07-08 09:14 被阅读0次
def agentLabel

if (profile== "test") {
    agentLabel = "test"
} else if (profile== "uat") {
    agentLabel = "uat"
} else {
    agentLabel = "prd"
}

pipeline {
    agent { label agentLabel }
    
    stages{
        stage('test dynamically agent'){
            steps{
                script{
                    println agentLabel
                }
            }
        }
    }
}

参考文档

相关文章

网友评论

      本文标题:jenkins pipeline 声明式agent动态设置代理标

      本文链接:https://www.haomeiwen.com/subject/fkdqcktx.html