Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-41581

Declarative: Support for multiple docker agents run in parallel and communicating

      Declarative does not have structures to support docker.withRun as in this example, from "Running the Tests" section of this blog post:
      (https://jenkins.io/blog/2016/08/10/rails-cd-with-pipeline/#writing-the-pipeline)

      node('docker') {
          docker.image('postgres').withRun { container ->
              docker.image('rtyler/rvm:2.3.0').inside("--link=${container.id}:postgres") { 
                  rvm "bundle install"
      
                  withEnv(['DATABASE_URL=postgres://postgres@postgres:5432/']) { 
                      rvm "bundle exec rake"
                  }
                  junit 'spec/reports/*.xml' 
              }
          }
      }
      

      Note, the example in the blog includes stages inside the inner docker agent, but that is a separate concept.

          [JENKINS-41581] Declarative: Support for multiple docker agents run in parallel and communicating

          Liam Newman created issue -
          Liam Newman made changes -
          Description Original:
          Declarative does not have structures to support {{docker.withRun}} as in this example, from "Running the Tests" section of this blog post:
          (https://jenkins.io/blog/2016/08/10/rails-cd-with-pipeline/#writing-the-pipeline)

          {code:language=groovy}
          node('docker') {
              docker.image('postgres').withRun { container ->
                  docker.image('rtyler/rvm:2.3.0').inside("--link=${container.id}:postgres") {
                      stage 'Install Gems'
                      rvm "bundle install"

                      stage 'Invoke Rake'
                      withEnv(['DATABASE_URL=postgres://postgres@postgres:5432/']) {
                          rvm "bundle exec rake"
                      }
                      junit 'spec/reports/*.xml'
                  }
              }
          }
          {code}
          New: Declarative does not have structures to support {{docker.withRun}} as in this example, from "Running the Tests" section of this blog post:
          (https://jenkins.io/blog/2016/08/10/rails-cd-with-pipeline/#writing-the-pipeline)

          {code:language=groovy}
          node('docker') {
              docker.image('postgres').withRun { container ->
                  docker.image('rtyler/rvm:2.3.0').inside("--link=${container.id}:postgres") {
                      rvm "bundle install"

                      withEnv(['DATABASE_URL=postgres://postgres@postgres:5432/']) {
                          rvm "bundle exec rake"
                      }
                      junit 'spec/reports/*.xml'
                  }
              }
          }
          {code}
          Liam Newman made changes -
          Description Original: Declarative does not have structures to support {{docker.withRun}} as in this example, from "Running the Tests" section of this blog post:
          (https://jenkins.io/blog/2016/08/10/rails-cd-with-pipeline/#writing-the-pipeline)

          {code:language=groovy}
          node('docker') {
              docker.image('postgres').withRun { container ->
                  docker.image('rtyler/rvm:2.3.0').inside("--link=${container.id}:postgres") {
                      rvm "bundle install"

                      withEnv(['DATABASE_URL=postgres://postgres@postgres:5432/']) {
                          rvm "bundle exec rake"
                      }
                      junit 'spec/reports/*.xml'
                  }
              }
          }
          {code}
          New: Declarative does not have structures to support {{docker.withRun}} as in this example, from "Running the Tests" section of this blog post:
          (https://jenkins.io/blog/2016/08/10/rails-cd-with-pipeline/#writing-the-pipeline)

          {code:language=groovy}
          node('docker') {
              docker.image('postgres').withRun { container ->
                  docker.image('rtyler/rvm:2.3.0').inside("--link=${container.id}:postgres") {
                      rvm "bundle install"

                      withEnv(['DATABASE_URL=postgres://postgres@postgres:5432/']) {
                          rvm "bundle exec rake"
                      }
                      junit 'spec/reports/*.xml'
                  }
              }
          }
          {code}

          Note, the example in the blog includes stages inside the inner docker agent, but that is a separate concept.
          James Dumay made changes -
          Epic Link New: JENKINS-45381 [ 183541 ]
          James Dumay made changes -
          Rank New: Ranked higher
          James Dumay made changes -
          Rank New: Ranked lower
          James Dumay made changes -
          Link New: This issue duplicates JENKINS-46336 [ JENKINS-46336 ]
          James Dumay made changes -
          Resolution New: Duplicate [ 3 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          Liam Newman added a comment -

          Bulk closing resolved issues.

          Liam Newman added a comment - Bulk closing resolved issues.
          Liam Newman made changes -
          Status Original: Resolved [ 5 ] New: Closed [ 6 ]

            abayer Andrew Bayer
            bitwiseman Liam Newman
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: