I'm attempting to use parallel builders in my scripted jenkinsfile. When I run the code jenkins is ignoring the node labels and just choosing the first available. What am I doing wrong?
here is the code:
node {
withCredentials([
string(credentialsId: 'some ID', variable: 'some variable')
]) {
stage('Initialize') {
setup()
}
}
}
}
def setup_worker() {
def labels = ['label2', 'label1']
def builders = [:]
for (x in labels) {
def label = x
builders[label] = {
node(label) {
stage('Setup') {
step1
checkout scm
login()
write_config()
}
}
}
}
parallel builders
}```