Browse Source

add z-master stage to Jenkinsfile

The z-master stage will just run the integration-cli tests. The
existing z stage will run the unit tests and the integration
tests. In this way, PR check jobs will be shorter, but all
integration tests will run after PR is merged to master.

Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
(cherry picked from commit bdc1c1a02a791fcdf84618939274ef9957cc7ca8)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Andrew Hsu 6 years ago
parent
commit
23b7bdf785
1 changed files with 74 additions and 0 deletions
  1. 74 0
      Jenkinsfile

+ 74 - 0
Jenkinsfile

@@ -340,6 +340,7 @@ pipeline {
                                   -e DOCKER_EXPERIMENTAL \
                                   -e DOCKER_EXPERIMENTAL \
                                   -e DOCKER_GITCOMMIT=${GIT_COMMIT} \
                                   -e DOCKER_GITCOMMIT=${GIT_COMMIT} \
                                   -e DOCKER_GRAPHDRIVER \
                                   -e DOCKER_GRAPHDRIVER \
+                                  -e TEST_SKIP_INTEGRATION_CLI=1 \
                                   -e TIMEOUT="300m" \
                                   -e TIMEOUT="300m" \
                                   docker:${GIT_COMMIT} \
                                   docker:${GIT_COMMIT} \
                                   hack/make.sh \
                                   hack/make.sh \
@@ -376,6 +377,79 @@ pipeline {
                         }
                         }
                     }
                     }
                 }
                 }
+                stage('z-master') {
+                    when {
+                        beforeAgent true
+                        branch 'master'
+                        expression { params.z }
+                    }
+                    agent { label 's390x-ubuntu-1604' }
+                    // s390x machines run on Docker 18.06, and buildkit has some bugs on that version
+                    environment { DOCKER_BUILDKIT = '0' }
+
+                    stages {
+                        stage("Print info") {
+                            steps {
+                                sh 'docker version'
+                                sh 'docker info'
+                                sh '''
+                                echo "check-config.sh version: ${CHECK_CONFIG_COMMIT}"
+                                curl -fsSL -o ${WORKSPACE}/check-config.sh "https://raw.githubusercontent.com/moby/moby/${CHECK_CONFIG_COMMIT}/contrib/check-config.sh" \
+                                && bash ${WORKSPACE}/check-config.sh || true
+                                '''
+                            }
+                        }
+                        stage("Build dev image") {
+                            steps {
+                                sh '''
+                                docker build --force-rm --build-arg APT_MIRROR -t docker:${GIT_COMMIT} -f Dockerfile .
+                                '''
+                            }
+                        }
+                        stage("Integration-cli tests") {
+                            steps {
+                                sh '''
+                                docker run --rm -t --privileged \
+                                  -v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
+                                  --name docker-pr$BUILD_NUMBER \
+                                  -e DOCKER_GITCOMMIT=${GIT_COMMIT} \
+                                  -e DOCKER_GRAPHDRIVER \
+                                  -e TEST_SKIP_INTEGRATION=1 \
+                                  -e TIMEOUT="300m" \
+                                  docker:${GIT_COMMIT} \
+                                  hack/make.sh \
+                                    dynbinary \
+                                    test-integration
+                                '''
+                            }
+                        }
+                    }
+
+                    post {
+                        always {
+                            sh '''
+                            echo "Ensuring container killed."
+                            docker rm -vf docker-pr$BUILD_NUMBER || true
+                            '''
+
+                            sh '''
+                            echo "Chowning /workspace to jenkins user"
+                            docker run --rm -v "$WORKSPACE:/workspace" busybox chown -R "$(id -u):$(id -g)" /workspace
+                            '''
+
+                            sh '''
+                            echo "Creating bundles.tar.gz"
+                            find bundles -name '*.log' | xargs tar -czf s390x-master-bundles.tar.gz
+                            '''
+
+                            archiveArtifacts artifacts: 's390x-master-bundles.tar.gz'
+                        }
+                        cleanup {
+                            sh 'make clean'
+                            deleteDir()
+                        }
+                    }
+                }
                 stage('powerpc') {
                 stage('powerpc') {
                     when {
                     when {
                         beforeAgent true
                         beforeAgent true