-
Bug
-
Resolution: Duplicate
-
Major
-
None
-
Jenkins version 2.149 running on CentOS7, slaves are CentOS7 machines.
I have a pipeline with multiple stages that all run on a single label of a slave inside a docker container using a dockerfile directive, if I add a stage that has a different label and using a node directive for that specific stage then the stage fails with the following error.
13:14:23 [feature_VPC-795-e2e-develop-EF452P7T7LHQ5EOUGZMAVASZUDQBHZAET7G7APUGZSFQCS7RE5TQ] Running shell script
13:14:23 unknown flag: --workdir
13:14:23 See 'docker exec --help'.
This works fine
// start of pipeline pipeline { triggers { pollSCM '0 0 * * 0' } agent { node { label 'docker-slave' } } options { timestamps() disableConcurrentBuilds() } environment { CI = 'true' } stages { stage('test old slave') { steps { sh "date" } } stage('test new slave') { agent { node { label 'non-docker-slave' } } steps { sh "date" } // steps } // stage } //stages } // pipeline
This does not work
// start of pipeline pipeline { triggers { pollSCM '0 0 * * 0' } agent { dockerfile { label 'docker-slave' filename 'Dockerfile' } } options { timestamps() disableConcurrentBuilds() } environment { CI = 'true' } stages { stage('test old slave') { steps { sh "date" } } stage('test new slave') { agent { node { label 'non-docker-slave' } } steps { sh "date" } // steps } // stage } //stages } // pipeline
- duplicates
-
JENKINS-46831 Not able to use a normal agent on stage when agent docker is declared globally
- Open