I have a multi-branch pipeline setup and would like to execute more stages when building on the "master" branch. This means, I also have to run the pipeline on a different agent when running on the master branch.
Is it possible to specify the agent based on a condition in the Jenkinsfile?
Something like,
pipeline {
agent {
label env.BRANCH_NAME == "master" ? "MasterAgent" : "OtherAgent"
}
}
Or some other way to achieve this requirement?