I have a Jenkins master and pool of slave nodes which dynamically grows and shrinks (based on load). The master node is called "master" and the slaves have guids for names. Currently none of the nodes have labels.
For my project, I want the "develop" branch from github to build on the master node and pull request branches to build on any one of the slaves. This has been working successfully in a scripted pipeline using node('master') and node('!master').
I would like to start using the new Declarative style of pipeline. Is it currently possible to achieve the same "master" and "not master" behaviour in a Declarative Pipeline, based on the branch name?
In the scripted pipeline, it looks like this:
def selectedNode = BRANCH_NAME == 'develop' ? 'master' : '!master'
node(selectedNode) {
}
Thanks