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.










share|improve this question

























    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.










    share|improve this question























      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.










      share|improve this question













      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 9 at 20:59









      user3903148

      31




      31






















          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"










          share|improve this answer




















          • 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










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          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

























          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"










          share|improve this answer




















          • 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














          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"










          share|improve this answer




















          • 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












          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"










          share|improve this answer












          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"











          share|improve this answer












          share|improve this answer



          share|improve this answer










          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
















          • 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

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          Kleinkühnau

          Makov (Slowakei)

          Deutsches Schauspielhaus