Can I set a label instead of a name for Groovy nodes? We want to define labels outside the script so that we can easily access them from the Jenkins toolbar.
Idea: Instead:
Groovy script
node('Slave_1 || Slave_2'){ echo 'Hello world' }
We want something like this:
Pipeline configuration
Node Label Name: slaveGroup
Node Label Value: Slave_1 || Slave_2
Groovy script
node(slaveGroup){echo 'Hello world'}
Or can you use labels that you can set in the sub configuration directly in the Groovy script?
source
share