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
}
}
}
}
}
网友评论