-
Task
-
Resolution: Unresolved
-
Minor
When using Jenkins X we have build packs with Jenkisnfiles using `agent` labels for pod templates and kubernetes plugins like this:
e.g. our build packs use Jenkinsfiles like this:
https://github.com/jenkins-x/draft-packs/blob/2.1/packs/maven/Jenkinsfile#L2 vs
with
agent {
label "jenkins-maven"
}
for serverless jenkins we had to create a branch in the build pack like this:
https://github.com/jenkins-x/draft-packs/blob/prow/packs/maven/Jenkinsfile#L2
using
agent any
It would be awesome to have a CLI argument or environment variable that basically ignores the `agent` setting! Then we won't need to have a separate set of build packs for serverless
I do not think you need any help from JFR. In your CasC, just write
That should make the master node be treated as having that label.
In general ignoring the agent block is not a good idea because it can have all sorts of configuration, like a Dockerfile reference or a pod specification. A build run in serverless mode is fundamentally different and you cannot assume that a single Jenkinsfile will work for both modes.