In a declarative jenkins pipeline – can I set the agent label dynamically?

Here is how I made it: mix scripted and declarative pipeline. First I’ve used scripted syntax to find, for example, the branch I’m on. Then define AGENT_LABEL variable. This var can be used anywhere along the declarative pipeline def AGENT_LABEL = null node(‘master’) { stage(‘Checkout and set agent’){ checkout scm ### Or just use any … Read more