I've restricted builds that my Jenkins master executes, since all its slaves are more powerful than it, in Node security settings.
I mean: "Manage Jenkins" -> "Manage nodes" -> master -> "Configure" -> check "Restrict jobs that run on this node" -> "Job restriction" -> "Regular expression". Then enter regexp like ^exact_allowed_job_name$
.
Now a pipeline job is stuck in the pending state ("Waiting for next available executor on master").
I cannot find any means to specify a slave that should execute this job in job settings, like the "Restrict where this project can be run" checkbox in freestyle jobs.
Is it possible?
Specifying labels doesn't help. It was the first that I've tried.
This simple pipeline anyway wants the master, regardless 'special'
label.
#!/usr/bin/env groovy
node('special') {
stage('checkout') {
echo 'checkout'
}
}
This pipeline is stuck too.
#!/usr/bin/env groovy
pipeline {
agent none
stages {
stage('Checkout'){
agent {
label 'special'
}
steps {
echo 'Checkout'
}
}
}
}