Jenkins declarative pipline multiple slave
up vote
0
down vote
favorite
I have a pipeline with multiple stages, some of them are in parallel. Up until now I had a single code block indicating where the job should run.
pipeline
triggers pollSCM '0 0 * * 0'
agent dockerfile label 'jenkins-slave'
filename 'Dockerfile'
stages
stage('1')
steps sh "blah"
// stage
// stages
// pipeline
What I need to do now is run a new stage on a different slave, NOT in docker.
I tried by adding an agent statement for that stage but it seems like it tries to run that stage withing a docker container on the second slave.
stage('test new slave')
agent node label 'e2e-aws'
steps
sh "ifconfig"
// steps
// stage
I get the following error message
13:14:23 unknown flag: --workdir
13:14:23 See 'docker exec --help'.
I tried setting the agent to none for the pipeline and using an agent for every step and have run into 2 issues
1. My post actions show an error
2. The stages that have parallel stages also had an error.
I can't find any examples that are similar to what I am doing.
docker jenkins jenkins-pipeline pipeline
add a comment |
up vote
0
down vote
favorite
I have a pipeline with multiple stages, some of them are in parallel. Up until now I had a single code block indicating where the job should run.
pipeline
triggers pollSCM '0 0 * * 0'
agent dockerfile label 'jenkins-slave'
filename 'Dockerfile'
stages
stage('1')
steps sh "blah"
// stage
// stages
// pipeline
What I need to do now is run a new stage on a different slave, NOT in docker.
I tried by adding an agent statement for that stage but it seems like it tries to run that stage withing a docker container on the second slave.
stage('test new slave')
agent node label 'e2e-aws'
steps
sh "ifconfig"
// steps
// stage
I get the following error message
13:14:23 unknown flag: --workdir
13:14:23 See 'docker exec --help'.
I tried setting the agent to none for the pipeline and using an agent for every step and have run into 2 issues
1. My post actions show an error
2. The stages that have parallel stages also had an error.
I can't find any examples that are similar to what I am doing.
docker jenkins jenkins-pipeline pipeline
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a pipeline with multiple stages, some of them are in parallel. Up until now I had a single code block indicating where the job should run.
pipeline
triggers pollSCM '0 0 * * 0'
agent dockerfile label 'jenkins-slave'
filename 'Dockerfile'
stages
stage('1')
steps sh "blah"
// stage
// stages
// pipeline
What I need to do now is run a new stage on a different slave, NOT in docker.
I tried by adding an agent statement for that stage but it seems like it tries to run that stage withing a docker container on the second slave.
stage('test new slave')
agent node label 'e2e-aws'
steps
sh "ifconfig"
// steps
// stage
I get the following error message
13:14:23 unknown flag: --workdir
13:14:23 See 'docker exec --help'.
I tried setting the agent to none for the pipeline and using an agent for every step and have run into 2 issues
1. My post actions show an error
2. The stages that have parallel stages also had an error.
I can't find any examples that are similar to what I am doing.
docker jenkins jenkins-pipeline pipeline
I have a pipeline with multiple stages, some of them are in parallel. Up until now I had a single code block indicating where the job should run.
pipeline
triggers pollSCM '0 0 * * 0'
agent dockerfile label 'jenkins-slave'
filename 'Dockerfile'
stages
stage('1')
steps sh "blah"
// stage
// stages
// pipeline
What I need to do now is run a new stage on a different slave, NOT in docker.
I tried by adding an agent statement for that stage but it seems like it tries to run that stage withing a docker container on the second slave.
stage('test new slave')
agent node label 'e2e-aws'
steps
sh "ifconfig"
// steps
// stage
I get the following error message
13:14:23 unknown flag: --workdir
13:14:23 See 'docker exec --help'.
I tried setting the agent to none for the pipeline and using an agent for every step and have run into 2 issues
1. My post actions show an error
2. The stages that have parallel stages also had an error.
I can't find any examples that are similar to what I am doing.
docker jenkins jenkins-pipeline pipeline
docker jenkins jenkins-pipeline pipeline
asked Nov 9 at 20:59
user3903148
31
31
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
You can use the node block to select a node to run a particular stage.
pipeline
agent any
stages
stage('Init')
steps
node('master')
echo "Run inside a MASTER"
That's exactly what I tried, it tries to run that stage also in docker even though it has no docker or dockerfile directive.
– user3903148
Nov 11 at 19:18
Could you please share the log of the pipeline that I shared above?
– Ram Kamath
Nov 11 at 19:29
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
You can use the node block to select a node to run a particular stage.
pipeline
agent any
stages
stage('Init')
steps
node('master')
echo "Run inside a MASTER"
That's exactly what I tried, it tries to run that stage also in docker even though it has no docker or dockerfile directive.
– user3903148
Nov 11 at 19:18
Could you please share the log of the pipeline that I shared above?
– Ram Kamath
Nov 11 at 19:29
add a comment |
up vote
0
down vote
You can use the node block to select a node to run a particular stage.
pipeline
agent any
stages
stage('Init')
steps
node('master')
echo "Run inside a MASTER"
That's exactly what I tried, it tries to run that stage also in docker even though it has no docker or dockerfile directive.
– user3903148
Nov 11 at 19:18
Could you please share the log of the pipeline that I shared above?
– Ram Kamath
Nov 11 at 19:29
add a comment |
up vote
0
down vote
up vote
0
down vote
You can use the node block to select a node to run a particular stage.
pipeline
agent any
stages
stage('Init')
steps
node('master')
echo "Run inside a MASTER"
You can use the node block to select a node to run a particular stage.
pipeline
agent any
stages
stage('Init')
steps
node('master')
echo "Run inside a MASTER"
answered Nov 10 at 18:16
Ram Kamath
499312
499312
That's exactly what I tried, it tries to run that stage also in docker even though it has no docker or dockerfile directive.
– user3903148
Nov 11 at 19:18
Could you please share the log of the pipeline that I shared above?
– Ram Kamath
Nov 11 at 19:29
add a comment |
That's exactly what I tried, it tries to run that stage also in docker even though it has no docker or dockerfile directive.
– user3903148
Nov 11 at 19:18
Could you please share the log of the pipeline that I shared above?
– Ram Kamath
Nov 11 at 19:29
That's exactly what I tried, it tries to run that stage also in docker even though it has no docker or dockerfile directive.
– user3903148
Nov 11 at 19:18
That's exactly what I tried, it tries to run that stage also in docker even though it has no docker or dockerfile directive.
– user3903148
Nov 11 at 19:18
Could you please share the log of the pipeline that I shared above?
– Ram Kamath
Nov 11 at 19:29
Could you please share the log of the pipeline that I shared above?
– Ram Kamath
Nov 11 at 19:29
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53233200%2fjenkins-declarative-pipline-multiple-slave%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown