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

Replace Declarative Docker agent directive with new implementation

    XMLWordPrintable

    Details

    • Similar Issues:
    • Sprint:
      Declarative - 1.2, Pipeline - December, Pipeline - April 2018

      Description

      Goals

      • We want to have a new implementation for running steps inside a Docker container that is transparent to the Pipeline author
      • We want to ensure that as this developed that we start making changes that allow us to swap out the implementation in the future (e.g. docker, k8, etc)
      • We want customers to try this new implementation without having to use patched plugins or special builds from a branch

      Scope

      • Declarative Docker agent directive can be used to run steps for a stage or for the whole pipeline
      • The new implementation can be enabled by specifying Pipeline->Options->dockerPipelineVersion = 2
      • Must be able to use an off the shelf docker container without modifying it so it works with Jenkins
      • Honour the entry point of the container
      • Sharing the workspace from the top level agent to a per stage Docker agent (and back again!)

      Out of scope

      • Declarative Docker agent directive that specifies a Dockerfile
      • Scripted docker.inside
      • Scripted docker.build
      • Building containers
      • Linked containers
      • Caching directories

      Acceptance criteria
      The following steps should work using the new implementation (even if modifications are needed to these steps):

      • withMaven()
      • dir()
      • withCredentials

      The following functionality should work:

      • Tool installers
      • Config File Provider

      Examples
      Per stage

      pipeline {
        options {
          dockerPipelineVersion(2)
        }
        agent none // Will not reuse workspace
        stages {
           stage (‘build’) {
              agent { docker ‘maven3’ } 
              steps { 
      	   sh ‘mvn clean test’
              } 
           }
        }
      }
      

      Whole Pipeline

      pipeline {
        options {
          dockerPipelineVersion(2)
        }
        agent { docker ‘maven3’ } // will reuse workspace for all stages unless specified
        stages {
           stage (‘build’) {
              steps { 
      	   sh ‘mvn clean test’
              } 
           }
        }
      }
      

        Attachments

          Issue Links

            Activity

            jamesdumay James Dumay created issue -
            jamesdumay James Dumay made changes -
            Field Original Value New Value
            Epic Link JENKINS-47962 [ 186491 ]
            jamesdumay James Dumay made changes -
            Description *Goal*
            We want to have a new implementation for running steps inside a Docker container that is transparent to the Pipeline author.

            _Per stage_
            {code}
            pipeline {
              options {
                dockerPipelineVersion: 2
              }
              agent none // Will not reuse workspace
              stages {
                 stage (‘build’) {
                    agent { docker ‘maven3’ }
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}

            _Whole Pipeline_
            {code}
            pipeline {
              options {
                dockerPipelineVersion: 2
              }
              agent { docker ‘maven3’ } // will reuse workspace for all stages unless specified
              stages {
                 stage (‘build’) {
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}

            *Scope*
            * Declarative Docker agent directive can be used to run steps for a stage or for the whole pipeline
            * The new implementation can be enabled by specifying Pipeline->Options->dockerPipelineVersion = 2
            * Must be able to use an off the shelf docker container without modifying it so it works with Jenkins.

            *Out of scope*
            * Declarative Docker agent directive that specifies a Dockerfile
            * Scripted {{docker.inside}}
            * Linked containers

            *Acceptance criteria*
            The following steps should work using the new implementation (even if modifications are needed to these steps):
            * withMaven()
            * dir()
            *Goal*
            We want to have a new implementation for running steps inside a Docker container that is transparent to the Pipeline author.

            _Per stage_
            {code}
            pipeline {
              options {
                dockerPipelineVersion: 2
              }
              agent none // Will not reuse workspace
              stages {
                 stage (‘build’) {
                    agent { docker ‘maven3’ }
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}

            _Whole Pipeline_
            {code}
            pipeline {
              options {
                dockerPipelineVersion: 2
              }
              agent { docker ‘maven3’ } // will reuse workspace for all stages unless specified
              stages {
                 stage (‘build’) {
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}

            *Scope*
            * Declarative Docker agent directive can be used to run steps for a stage or for the whole pipeline
            * The new implementation can be enabled by specifying Pipeline->Options->dockerPipelineVersion = 2
            * Must be able to use an off the shelf docker container without modifying it so it works with Jenkins
            * Honour the entry point of the container

            *Out of scope*
            * Declarative Docker agent directive that specifies a Dockerfile
            * Scripted {{docker.inside}}
            * Linked containers

            *Acceptance criteria*
            The following steps should work using the new implementation (even if modifications are needed to these steps):
            * withMaven()
            * dir()
            jamesdumay James Dumay made changes -
            Description *Goal*
            We want to have a new implementation for running steps inside a Docker container that is transparent to the Pipeline author.

            _Per stage_
            {code}
            pipeline {
              options {
                dockerPipelineVersion: 2
              }
              agent none // Will not reuse workspace
              stages {
                 stage (‘build’) {
                    agent { docker ‘maven3’ }
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}

            _Whole Pipeline_
            {code}
            pipeline {
              options {
                dockerPipelineVersion: 2
              }
              agent { docker ‘maven3’ } // will reuse workspace for all stages unless specified
              stages {
                 stage (‘build’) {
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}

            *Scope*
            * Declarative Docker agent directive can be used to run steps for a stage or for the whole pipeline
            * The new implementation can be enabled by specifying Pipeline->Options->dockerPipelineVersion = 2
            * Must be able to use an off the shelf docker container without modifying it so it works with Jenkins
            * Honour the entry point of the container

            *Out of scope*
            * Declarative Docker agent directive that specifies a Dockerfile
            * Scripted {{docker.inside}}
            * Linked containers

            *Acceptance criteria*
            The following steps should work using the new implementation (even if modifications are needed to these steps):
            * withMaven()
            * dir()
            *Goal*
            We want to have a new implementation for running steps inside a Docker container that is transparent to the Pipeline author. We want to ensure that as this developed that we start making changes that allow us to swap out the implementation in the future (e.g. docker, k8, etc)

            *Scope*
            * Declarative Docker agent directive can be used to run steps for a stage or for the whole pipeline
            * The new implementation can be enabled by specifying Pipeline->Options->dockerPipelineVersion = 2
            * Must be able to use an off the shelf docker container without modifying it so it works with Jenkins
            * Honour the entry point of the container

            *Out of scope*
            * Declarative Docker agent directive that specifies a Dockerfile
            * Scripted {{docker.inside}}
            * Linked containers

            *Acceptance criteria*
            The following steps should work using the new implementation (even if modifications are needed to these steps):
            * withMaven()
            * dir()

            *Examples*
            _Per stage_
            {code}
            pipeline {
              options {
                dockerPipelineVersion: 2
              }
              agent none // Will not reuse workspace
              stages {
                 stage (‘build’) {
                    agent { docker ‘maven3’ }
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}

            _Whole Pipeline_
            {code}
            pipeline {
              options {
                dockerPipelineVersion: 2
              }
              agent { docker ‘maven3’ } // will reuse workspace for all stages unless specified
              stages {
                 stage (‘build’) {
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}
            jamesdumay James Dumay made changes -
            Description *Goal*
            We want to have a new implementation for running steps inside a Docker container that is transparent to the Pipeline author. We want to ensure that as this developed that we start making changes that allow us to swap out the implementation in the future (e.g. docker, k8, etc)

            *Scope*
            * Declarative Docker agent directive can be used to run steps for a stage or for the whole pipeline
            * The new implementation can be enabled by specifying Pipeline->Options->dockerPipelineVersion = 2
            * Must be able to use an off the shelf docker container without modifying it so it works with Jenkins
            * Honour the entry point of the container

            *Out of scope*
            * Declarative Docker agent directive that specifies a Dockerfile
            * Scripted {{docker.inside}}
            * Linked containers

            *Acceptance criteria*
            The following steps should work using the new implementation (even if modifications are needed to these steps):
            * withMaven()
            * dir()

            *Examples*
            _Per stage_
            {code}
            pipeline {
              options {
                dockerPipelineVersion: 2
              }
              agent none // Will not reuse workspace
              stages {
                 stage (‘build’) {
                    agent { docker ‘maven3’ }
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}

            _Whole Pipeline_
            {code}
            pipeline {
              options {
                dockerPipelineVersion: 2
              }
              agent { docker ‘maven3’ } // will reuse workspace for all stages unless specified
              stages {
                 stage (‘build’) {
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}
            *Goal*
            We want to have a new implementation for running steps inside a Docker container that is transparent to the Pipeline author. We want to ensure that as this developed that we start making changes that allow us to swap out the implementation in the future (e.g. docker, k8, etc)

            *Scope*
            * Declarative Docker agent directive can be used to run steps for a stage or for the whole pipeline
            * The new implementation can be enabled by specifying Pipeline->Options->dockerPipelineVersion = 2
            * Must be able to use an off the shelf docker container without modifying it so it works with Jenkins
            * Honour the entry point of the container

            *Out of scope*
            * Declarative Docker agent directive that specifies a {{Dockerfile}}
            * Scripted {{docker.inside}}
            * Linked containers

            *Acceptance criteria*
            The following steps should work using the new implementation (even if modifications are needed to these steps):
            * {{withMaven()}}
            * {{dir()}}

            *Examples*
            _Per stage_
            {code}
            pipeline {
              options {
                dockerPipelineVersion: 2
              }
              agent none // Will not reuse workspace
              stages {
                 stage (‘build’) {
                    agent { docker ‘maven3’ }
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}

            _Whole Pipeline_
            {code}
            pipeline {
              options {
                dockerPipelineVersion: 2
              }
              agent { docker ‘maven3’ } // will reuse workspace for all stages unless specified
              stages {
                 stage (‘build’) {
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}
            jamesdumay James Dumay made changes -
            Description *Goal*
            We want to have a new implementation for running steps inside a Docker container that is transparent to the Pipeline author. We want to ensure that as this developed that we start making changes that allow us to swap out the implementation in the future (e.g. docker, k8, etc)

            *Scope*
            * Declarative Docker agent directive can be used to run steps for a stage or for the whole pipeline
            * The new implementation can be enabled by specifying Pipeline->Options->dockerPipelineVersion = 2
            * Must be able to use an off the shelf docker container without modifying it so it works with Jenkins
            * Honour the entry point of the container

            *Out of scope*
            * Declarative Docker agent directive that specifies a {{Dockerfile}}
            * Scripted {{docker.inside}}
            * Linked containers

            *Acceptance criteria*
            The following steps should work using the new implementation (even if modifications are needed to these steps):
            * {{withMaven()}}
            * {{dir()}}

            *Examples*
            _Per stage_
            {code}
            pipeline {
              options {
                dockerPipelineVersion: 2
              }
              agent none // Will not reuse workspace
              stages {
                 stage (‘build’) {
                    agent { docker ‘maven3’ }
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}

            _Whole Pipeline_
            {code}
            pipeline {
              options {
                dockerPipelineVersion: 2
              }
              agent { docker ‘maven3’ } // will reuse workspace for all stages unless specified
              stages {
                 stage (‘build’) {
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}
            *Goal*
            We want to have a new implementation for running steps inside a Docker container that is transparent to the Pipeline author. We want to ensure that as this developed that we start making changes that allow us to swap out the implementation in the future (e.g. docker, k8, etc)

            *Scope*
            * Declarative Docker agent directive can be used to run steps for a stage or for the whole pipeline
            * The new implementation can be enabled by specifying Pipeline->Options->dockerPipelineVersion = 2
            * Must be able to use an off the shelf docker container without modifying it so it works with Jenkins
            * Honour the entry point of the container

            *Out of scope*
            * Declarative Docker agent directive that specifies a {{Dockerfile}}
            * Scripted {{docker.inside}}
            * Scripted {{docker.build}}
            * Building containers
            * Linked containers

            *Acceptance criteria*
            The following steps should work using the new implementation (even if modifications are needed to these steps):
            * {{withMaven()}}
            * {{dir()}}

            *Examples*
            _Per stage_
            {code}
            pipeline {
              options {
                dockerPipelineVersion: 2
              }
              agent none // Will not reuse workspace
              stages {
                 stage (‘build’) {
                    agent { docker ‘maven3’ }
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}

            _Whole Pipeline_
            {code}
            pipeline {
              options {
                dockerPipelineVersion: 2
              }
              agent { docker ‘maven3’ } // will reuse workspace for all stages unless specified
              stages {
                 stage (‘build’) {
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}
            jamesdumay James Dumay made changes -
            Description *Goal*
            We want to have a new implementation for running steps inside a Docker container that is transparent to the Pipeline author. We want to ensure that as this developed that we start making changes that allow us to swap out the implementation in the future (e.g. docker, k8, etc)

            *Scope*
            * Declarative Docker agent directive can be used to run steps for a stage or for the whole pipeline
            * The new implementation can be enabled by specifying Pipeline->Options->dockerPipelineVersion = 2
            * Must be able to use an off the shelf docker container without modifying it so it works with Jenkins
            * Honour the entry point of the container

            *Out of scope*
            * Declarative Docker agent directive that specifies a {{Dockerfile}}
            * Scripted {{docker.inside}}
            * Scripted {{docker.build}}
            * Building containers
            * Linked containers

            *Acceptance criteria*
            The following steps should work using the new implementation (even if modifications are needed to these steps):
            * {{withMaven()}}
            * {{dir()}}

            *Examples*
            _Per stage_
            {code}
            pipeline {
              options {
                dockerPipelineVersion: 2
              }
              agent none // Will not reuse workspace
              stages {
                 stage (‘build’) {
                    agent { docker ‘maven3’ }
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}

            _Whole Pipeline_
            {code}
            pipeline {
              options {
                dockerPipelineVersion: 2
              }
              agent { docker ‘maven3’ } // will reuse workspace for all stages unless specified
              stages {
                 stage (‘build’) {
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}
            *Goals*
            * We want to have a new implementation for running steps inside a Docker container that is transparent to the Pipeline author
            * We want to ensure that as this developed that we start making changes that allow us to swap out the implementation in the future (e.g. docker, k8, etc)
            * We want customers to try this new implementation without having to use patched plugins or special builds from a branch


            *Scope*
            * Declarative Docker agent directive can be used to run steps for a stage or for the whole pipeline
            * The new implementation can be enabled by specifying Pipeline->Options->dockerPipelineVersion = 2
            * Must be able to use an off the shelf docker container without modifying it so it works with Jenkins
            * Honour the entry point of the container

            *Out of scope*
            * Declarative Docker agent directive that specifies a {{Dockerfile}}
            * Scripted {{docker.inside}}
            * Scripted {{docker.build}}
            * Building containers
            * Linked containers

            *Acceptance criteria*
            The following steps should work using the new implementation (even if modifications are needed to these steps):
            * {{withMaven()}}
            * {{dir()}}

            *Examples*
            _Per stage_
            {code}
            pipeline {
              options {
                dockerPipelineVersion: 2
              }
              agent none // Will not reuse workspace
              stages {
                 stage (‘build’) {
                    agent { docker ‘maven3’ }
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}

            _Whole Pipeline_
            {code}
            pipeline {
              options {
                dockerPipelineVersion: 2
              }
              agent { docker ‘maven3’ } // will reuse workspace for all stages unless specified
              stages {
                 stage (‘build’) {
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}
            abayer Andrew Bayer made changes -
            Description *Goals*
            * We want to have a new implementation for running steps inside a Docker container that is transparent to the Pipeline author
            * We want to ensure that as this developed that we start making changes that allow us to swap out the implementation in the future (e.g. docker, k8, etc)
            * We want customers to try this new implementation without having to use patched plugins or special builds from a branch


            *Scope*
            * Declarative Docker agent directive can be used to run steps for a stage or for the whole pipeline
            * The new implementation can be enabled by specifying Pipeline->Options->dockerPipelineVersion = 2
            * Must be able to use an off the shelf docker container without modifying it so it works with Jenkins
            * Honour the entry point of the container

            *Out of scope*
            * Declarative Docker agent directive that specifies a {{Dockerfile}}
            * Scripted {{docker.inside}}
            * Scripted {{docker.build}}
            * Building containers
            * Linked containers

            *Acceptance criteria*
            The following steps should work using the new implementation (even if modifications are needed to these steps):
            * {{withMaven()}}
            * {{dir()}}

            *Examples*
            _Per stage_
            {code}
            pipeline {
              options {
                dockerPipelineVersion: 2
              }
              agent none // Will not reuse workspace
              stages {
                 stage (‘build’) {
                    agent { docker ‘maven3’ }
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}

            _Whole Pipeline_
            {code}
            pipeline {
              options {
                dockerPipelineVersion: 2
              }
              agent { docker ‘maven3’ } // will reuse workspace for all stages unless specified
              stages {
                 stage (‘build’) {
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}
            *Goals*
            * We want to have a new implementation for running steps inside a Docker container that is transparent to the Pipeline author
            * We want to ensure that as this developed that we start making changes that allow us to swap out the implementation in the future (e.g. docker, k8, etc)
            * We want customers to try this new implementation without having to use patched plugins or special builds from a branch


            *Scope*
            * Declarative Docker agent directive can be used to run steps for a stage or for the whole pipeline
            * The new implementation can be enabled by specifying Pipeline->Options->dockerPipelineVersion = 2
            * Must be able to use an off the shelf docker container without modifying it so it works with Jenkins
            * Honour the entry point of the container

            *Out of scope*
            * Declarative Docker agent directive that specifies a {{Dockerfile}}
            * Scripted {{docker.inside}}
            * Scripted {{docker.build}}
            * Building containers
            * Linked containers

            *Acceptance criteria*
            The following steps should work using the new implementation (even if modifications are needed to these steps):
            * {{withMaven()}}
            * {{dir()}}

            *Examples*
            _Per stage_
            {code}
            pipeline {
              options {
                dockerPipelineVersion(2)
              }
              agent none // Will not reuse workspace
              stages {
                 stage (‘build’) {
                    agent { docker ‘maven3’ }
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}

            _Whole Pipeline_
            {code}
            pipeline {
              options {
                dockerPipelineVersion(2)
              }
              agent { docker ‘maven3’ } // will reuse workspace for all stages unless specified
              stages {
                 stage (‘build’) {
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}
            michaelneale Michael Neale made changes -
            Component/s pipeline-model-definition-plugin [ 21706 ]
            jamesdumay James Dumay made changes -
            Description *Goals*
            * We want to have a new implementation for running steps inside a Docker container that is transparent to the Pipeline author
            * We want to ensure that as this developed that we start making changes that allow us to swap out the implementation in the future (e.g. docker, k8, etc)
            * We want customers to try this new implementation without having to use patched plugins or special builds from a branch


            *Scope*
            * Declarative Docker agent directive can be used to run steps for a stage or for the whole pipeline
            * The new implementation can be enabled by specifying Pipeline->Options->dockerPipelineVersion = 2
            * Must be able to use an off the shelf docker container without modifying it so it works with Jenkins
            * Honour the entry point of the container

            *Out of scope*
            * Declarative Docker agent directive that specifies a {{Dockerfile}}
            * Scripted {{docker.inside}}
            * Scripted {{docker.build}}
            * Building containers
            * Linked containers

            *Acceptance criteria*
            The following steps should work using the new implementation (even if modifications are needed to these steps):
            * {{withMaven()}}
            * {{dir()}}

            *Examples*
            _Per stage_
            {code}
            pipeline {
              options {
                dockerPipelineVersion(2)
              }
              agent none // Will not reuse workspace
              stages {
                 stage (‘build’) {
                    agent { docker ‘maven3’ }
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}

            _Whole Pipeline_
            {code}
            pipeline {
              options {
                dockerPipelineVersion(2)
              }
              agent { docker ‘maven3’ } // will reuse workspace for all stages unless specified
              stages {
                 stage (‘build’) {
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}
            *Goals*
            * We want to have a new implementation for running steps inside a Docker container that is transparent to the Pipeline author
            * We want to ensure that as this developed that we start making changes that allow us to swap out the implementation in the future (e.g. docker, k8, etc)
            * We want customers to try this new implementation without having to use patched plugins or special builds from a branch


            *Scope*
            * Declarative Docker agent directive can be used to run steps for a stage or for the whole pipeline
            * The new implementation can be enabled by specifying Pipeline->Options->dockerPipelineVersion = 2
            * Must be able to use an off the shelf docker container without modifying it so it works with Jenkins
            * Honour the entry point of the container
            * Sharing the workspace from the top level agent to a per stage Docker agent (and back again!)

            *Out of scope*
            * Declarative Docker agent directive that specifies a {{Dockerfile}}
            * Scripted {{docker.inside}}
            * Scripted {{docker.build}}
            * Building containers
            * Linked containers

            *Acceptance criteria*
            The following steps should work using the new implementation (even if modifications are needed to these steps):
            * {{withMaven()}}
            * {{dir()}}

            *Examples*
            _Per stage_
            {code}
            pipeline {
              options {
                dockerPipelineVersion(2)
              }
              agent none // Will not reuse workspace
              stages {
                 stage (‘build’) {
                    agent { docker ‘maven3’ }
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}

            _Whole Pipeline_
            {code}
            pipeline {
              options {
                dockerPipelineVersion(2)
              }
              agent { docker ‘maven3’ } // will reuse workspace for all stages unless specified
              stages {
                 stage (‘build’) {
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}
            michaelneale Michael Neale made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            jamesdumay James Dumay made changes -
            Description *Goals*
            * We want to have a new implementation for running steps inside a Docker container that is transparent to the Pipeline author
            * We want to ensure that as this developed that we start making changes that allow us to swap out the implementation in the future (e.g. docker, k8, etc)
            * We want customers to try this new implementation without having to use patched plugins or special builds from a branch


            *Scope*
            * Declarative Docker agent directive can be used to run steps for a stage or for the whole pipeline
            * The new implementation can be enabled by specifying Pipeline->Options->dockerPipelineVersion = 2
            * Must be able to use an off the shelf docker container without modifying it so it works with Jenkins
            * Honour the entry point of the container
            * Sharing the workspace from the top level agent to a per stage Docker agent (and back again!)

            *Out of scope*
            * Declarative Docker agent directive that specifies a {{Dockerfile}}
            * Scripted {{docker.inside}}
            * Scripted {{docker.build}}
            * Building containers
            * Linked containers

            *Acceptance criteria*
            The following steps should work using the new implementation (even if modifications are needed to these steps):
            * {{withMaven()}}
            * {{dir()}}

            *Examples*
            _Per stage_
            {code}
            pipeline {
              options {
                dockerPipelineVersion(2)
              }
              agent none // Will not reuse workspace
              stages {
                 stage (‘build’) {
                    agent { docker ‘maven3’ }
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}

            _Whole Pipeline_
            {code}
            pipeline {
              options {
                dockerPipelineVersion(2)
              }
              agent { docker ‘maven3’ } // will reuse workspace for all stages unless specified
              stages {
                 stage (‘build’) {
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}
            *Goals*
            * We want to have a new implementation for running steps inside a Docker container that is transparent to the Pipeline author
            * We want to ensure that as this developed that we start making changes that allow us to swap out the implementation in the future (e.g. docker, k8, etc)
            * We want customers to try this new implementation without having to use patched plugins or special builds from a branch


            *Scope*
            * Declarative Docker agent directive can be used to run steps for a stage or for the whole pipeline
            * The new implementation can be enabled by specifying Pipeline->Options->dockerPipelineVersion = 2
            * Must be able to use an off the shelf docker container without modifying it so it works with Jenkins
            * Honour the entry point of the container
            * Sharing the workspace from the top level agent to a per stage Docker agent (and back again!)

            *Out of scope*
            * Declarative Docker agent directive that specifies a {{Dockerfile}}
            * Scripted {{docker.inside}}
            * Scripted {{docker.build}}
            * Building containers
            * Linked containers

            *Acceptance criteria*
            The following steps should work using the new implementation (even if modifications are needed to these steps):
            * {{withMaven()}}
            * {{dir()}}
            * {{withCredentials}}

            The following functionality should work:
            * Tool installers

            *Examples*
            _Per stage_
            {code}
            pipeline {
              options {
                dockerPipelineVersion(2)
              }
              agent none // Will not reuse workspace
              stages {
                 stage (‘build’) {
                    agent { docker ‘maven3’ }
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}

            _Whole Pipeline_
            {code}
            pipeline {
              options {
                dockerPipelineVersion(2)
              }
              agent { docker ‘maven3’ } // will reuse workspace for all stages unless specified
              stages {
                 stage (‘build’) {
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}
            michaelneale Michael Neale made changes -
            Priority Minor [ 4 ] Major [ 3 ]
            jamesdumay James Dumay made changes -
            Description *Goals*
            * We want to have a new implementation for running steps inside a Docker container that is transparent to the Pipeline author
            * We want to ensure that as this developed that we start making changes that allow us to swap out the implementation in the future (e.g. docker, k8, etc)
            * We want customers to try this new implementation without having to use patched plugins or special builds from a branch


            *Scope*
            * Declarative Docker agent directive can be used to run steps for a stage or for the whole pipeline
            * The new implementation can be enabled by specifying Pipeline->Options->dockerPipelineVersion = 2
            * Must be able to use an off the shelf docker container without modifying it so it works with Jenkins
            * Honour the entry point of the container
            * Sharing the workspace from the top level agent to a per stage Docker agent (and back again!)

            *Out of scope*
            * Declarative Docker agent directive that specifies a {{Dockerfile}}
            * Scripted {{docker.inside}}
            * Scripted {{docker.build}}
            * Building containers
            * Linked containers

            *Acceptance criteria*
            The following steps should work using the new implementation (even if modifications are needed to these steps):
            * {{withMaven()}}
            * {{dir()}}
            * {{withCredentials}}

            The following functionality should work:
            * Tool installers

            *Examples*
            _Per stage_
            {code}
            pipeline {
              options {
                dockerPipelineVersion(2)
              }
              agent none // Will not reuse workspace
              stages {
                 stage (‘build’) {
                    agent { docker ‘maven3’ }
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}

            _Whole Pipeline_
            {code}
            pipeline {
              options {
                dockerPipelineVersion(2)
              }
              agent { docker ‘maven3’ } // will reuse workspace for all stages unless specified
              stages {
                 stage (‘build’) {
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}
            *Goals*
            * We want to have a new implementation for running steps inside a Docker container that is transparent to the Pipeline author
            * We want to ensure that as this developed that we start making changes that allow us to swap out the implementation in the future (e.g. docker, k8, etc)
            * We want customers to try this new implementation without having to use patched plugins or special builds from a branch


            *Scope*
            * Declarative Docker agent directive can be used to run steps for a stage or for the whole pipeline
            * The new implementation can be enabled by specifying Pipeline->Options->dockerPipelineVersion = 2
            * Must be able to use an off the shelf docker container without modifying it so it works with Jenkins
            * Honour the entry point of the container
            * Sharing the workspace from the top level agent to a per stage Docker agent (and back again!)

            *Out of scope*
            * Declarative Docker agent directive that specifies a {{Dockerfile}}
            * Scripted {{docker.inside}}
            * Scripted {{docker.build}}
            * Building containers
            * Linked containers
            * Caching directories

            *Acceptance criteria*
            The following steps should work using the new implementation (even if modifications are needed to these steps):
            * {{withMaven()}}
            * {{dir()}}
            * {{withCredentials}}

            The following functionality should work:
            * Tool installers
            * Config File Provider

            *Examples*
            _Per stage_
            {code}
            pipeline {
              options {
                dockerPipelineVersion(2)
              }
              agent none // Will not reuse workspace
              stages {
                 stage (‘build’) {
                    agent { docker ‘maven3’ }
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}

            _Whole Pipeline_
            {code}
            pipeline {
              options {
                dockerPipelineVersion(2)
              }
              agent { docker ‘maven3’ } // will reuse workspace for all stages unless specified
              stages {
                 stage (‘build’) {
                    steps {
            sh ‘mvn clean test’
                    }
                 }
              }
            }
            {code}
            michaelneale Michael Neale made changes -
            Labels cloudbees-internal-pipeline
            jamesdumay James Dumay made changes -
            Sprint Declarative - 1.2 [ 366 ]
            Labels cloudbees-internal-pipeline
            jamesdumay James Dumay made changes -
            Link This issue relates to JENKINS-40484 [ JENKINS-40484 ]
            cleclerc Cyrille Le Clerc made changes -
            Summary Replace Declarative Docker agent directive with new impelementation Replace Declarative Docker agent directive with new implementation
            csanchez Carlos Sanchez made changes -
            Link This issue blocks JENKINS-48135 [ JENKINS-48135 ]
            jamesdumay James Dumay made changes -
            Sprint Declarative - 1.2 [ 366 ] Declarative - 1.2, Pipeline - December [ 366, 446 ]
            jamesdumay James Dumay made changes -
            Rank Ranked lower
            cleclerc Cyrille Le Clerc made changes -
            Link This issue is related to JENKINS-47823 [ JENKINS-47823 ]
            cleclerc Cyrille Le Clerc made changes -
            Link This issue is related to JENKINS-48284 [ JENKINS-48284 ]
            schukai Volker Schukai made changes -
            Link This issue relates to JENKINS-48460 [ JENKINS-48460 ]
            stodorov Steve Todorov made changes -
            Link This issue relates to JENKINS-47805 [ JENKINS-47805 ]
            ndeloof Nicolas De Loof made changes -
            Issue Type Story [ 10002 ] Epic [ 10001 ]
            ndeloof Nicolas De Loof made changes -
            Epic Link JENKINS-47962 [ 186491 ]
            ndeloof Nicolas De Loof made changes -
            Labels docker
            ndeloof Nicolas De Loof made changes -
            Epic Child JENKINS-49748 [ 188691 ]
            vivek Vivek Pandey made changes -
            Sprint Declarative - 1.2, Pipeline - December [ 366, 446 ] Declarative - 1.2, Pipeline - December, Pipeline - March 2018 [ 366, 446, 506 ]
            ndeloof Nicolas De Loof made changes -
            Component/s docker-plugin [ 18724 ]
            ndeloof Nicolas De Loof made changes -
            Assignee Nicolas De Loof [ ndeloof ] Andrew Bayer [ abayer ]
            csanchez Carlos Sanchez made changes -
            Link This issue blocks JENKINS-48135 [ JENKINS-48135 ]
            csanchez Carlos Sanchez made changes -
            Link This issue is related to JENKINS-48135 [ JENKINS-48135 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "pipeline-model-definition PR 255 (Web Link)" [ 21348 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "Unfiled docker PR: ndeloof:JENKINS-48050 (Web Link)" [ 21350 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "docker PR 681 (Web Link)" [ 21352 ]
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-36776 [ JENKINS-36776 ]
            bitwiseman Liam Newman made changes -
            Remote Link This issue links to "PR-255 (Web Link)" [ 23025 ]
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-58732 [ JENKINS-58732 ]
            abayer Andrew Bayer made changes -
            Assignee Andrew Bayer [ abayer ]

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              jamesdumay James Dumay
              Votes:
              14 Vote for this issue
              Watchers:
              41 Start watching this issue

                Dates

                Created:
                Updated: