24144dbd |
#!groovy |
4d7721cd |
pipeline { |
5da534d8 |
agent none |
5bed8125 |
|
5da534d8 |
options {
buildDiscarder(logRotator(daysToKeepStr: '30')) |
75c408cb |
timeout(time: 2, unit: 'HOURS') |
5da534d8 |
timestamps()
}
parameters { |
ca22ec44 |
booleanParam(name: 'unit_validate', defaultValue: true, description: 'amd64 (x86_64) unit tests and vendor check')
booleanParam(name: 'amd64', defaultValue: true, description: 'amd64 (x86_64) Build/Test')
booleanParam(name: 's390x', defaultValue: true, description: 'IBM Z (s390x) Build/Test')
booleanParam(name: 'ppc64le', defaultValue: true, description: 'PowerPC (ppc64le) Build/Test') |
36fc8f58 |
booleanParam(name: 'windowsRS1', defaultValue: false, description: 'Windows 2016 (RS1) Build/Test') |
33926122 |
booleanParam(name: 'windowsRS5', defaultValue: true, description: 'Windows 2019 (RS5) Build/Test') |
9b836acd |
booleanParam(name: 'skip_dco', defaultValue: false, description: 'Skip the DCO check') |
5da534d8 |
} |
d9746741 |
environment { |
0a5ea9d3 |
DOCKER_BUILDKIT = '1' |
0d0b1e77 |
DOCKER_EXPERIMENTAL = '1' |
04ca2e6b |
DOCKER_GRAPHDRIVER = 'overlay2' |
0a5ea9d3 |
APT_MIRROR = 'cdn-fastly.deb.debian.org'
CHECK_CONFIG_COMMIT = '78405559cfe5987174aa2cb6463b9b2c1b917255' |
08573e29 |
TESTDEBUG = '0' |
75c408cb |
TIMEOUT = '120m' |
d9746741 |
} |
5da534d8 |
stages { |
5d74bd7e |
stage('pr-hack') {
when { changeRequest() }
steps {
script {
echo "Workaround for PR auto-cancel feature. Borrowed from https://issues.jenkins-ci.org/browse/JENKINS-43353"
def buildNumber = env.BUILD_NUMBER as int
if (buildNumber > 1) milestone(buildNumber - 1)
milestone(buildNumber)
}
}
} |
9b836acd |
stage('DCO-check') {
when {
beforeAgent true
expression { !params.skip_dco }
} |
5d74bd7e |
agent { label 'amd64 && ubuntu-1804 && overlay2' } |
9b836acd |
steps {
sh '''
docker run --rm \
-v "$WORKSPACE:/workspace" \ |
9c388fb1 |
-e VALIDATE_REPO=${GIT_URL} \
-e VALIDATE_BRANCH=${CHANGE_TARGET} \
alpine sh -c 'apk add --no-cache -q bash git openssh-client && cd /workspace && hack/validate/dco' |
9b836acd |
'''
}
} |
5da534d8 |
stage('Build') {
parallel { |
949708a7 |
stage('unit-validate') { |
5da534d8 |
when {
beforeAgent true |
949708a7 |
expression { params.unit_validate } |
5da534d8 |
}
agent { label 'amd64 && ubuntu-1804 && overlay2' } |
4d7721cd |
|
3040f3fd |
stages { |
337f0fc8 |
stage("Print info") {
steps {
sh 'docker version'
sh 'docker info' |
0a5ea9d3 |
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
''' |
337f0fc8 |
}
} |
3040f3fd |
stage("Build dev image") {
steps { |
c94dca16 |
sh 'docker build --force-rm --build-arg APT_MIRROR -t docker:${GIT_COMMIT} .' |
3040f3fd |
}
} |
63966dec |
stage("Validate") {
steps {
sh '''
docker run --rm -t --privileged \
-v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
-v "$WORKSPACE/.git:/go/src/github.com/docker/docker/.git" \
--name docker-pr$BUILD_NUMBER \ |
0d0b1e77 |
-e DOCKER_EXPERIMENTAL \ |
63966dec |
-e DOCKER_GITCOMMIT=${GIT_COMMIT} \
-e DOCKER_GRAPHDRIVER \ |
abbc956a |
-e VALIDATE_REPO=${GIT_URL} \
-e VALIDATE_BRANCH=${CHANGE_TARGET} \ |
63966dec |
docker:${GIT_COMMIT} \
hack/validate/default
'''
}
} |
30549cdb |
stage("Docker-py") {
steps {
sh '''
docker run --rm -t --privileged \
-v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
--name docker-pr$BUILD_NUMBER \ |
0d0b1e77 |
-e DOCKER_EXPERIMENTAL \ |
30549cdb |
-e DOCKER_GITCOMMIT=${GIT_COMMIT} \
-e DOCKER_GRAPHDRIVER \ |
abbc956a |
-e VALIDATE_REPO=${GIT_URL} \
-e VALIDATE_BRANCH=${CHANGE_TARGET} \ |
30549cdb |
docker:${GIT_COMMIT} \
hack/make.sh \ |
fb471aab |
dynbinary-daemon \ |
30549cdb |
test-docker-py
'''
} |
70303ded |
post {
always {
junit testResults: 'bundles/test-docker-py/junit-report.xml', allowEmptyResults: true |
83e7de55 |
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
'''
|
2d3475ba |
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', message: 'Failed to create bundles.tar.gz') {
sh '''
bundleName=docker-py
echo "Creating ${bundleName}-bundles.tar.gz"
tar -czf ${bundleName}-bundles.tar.gz bundles/test-docker-py/*.xml bundles/test-docker-py/*.log
'''
archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true
} |
70303ded |
}
} |
30549cdb |
} |
eee3f675 |
stage("Static") { |
34a8dcae |
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 \
docker:${GIT_COMMIT} \
hack/make.sh binary-daemon
'''
}
}
stage("Cross") {
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 \
docker:${GIT_COMMIT} \
hack/make.sh cross
'''
}
}
// needs to be last stage that calls make.sh for the junit report to work |
949708a7 |
stage("Unit tests") { |
3040f3fd |
steps {
sh '''
docker run --rm -t --privileged \
-v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
--name docker-pr$BUILD_NUMBER \ |
0d0b1e77 |
-e DOCKER_EXPERIMENTAL \ |
b81c7624 |
-e DOCKER_GITCOMMIT=${GIT_COMMIT} \ |
04ca2e6b |
-e DOCKER_GRAPHDRIVER \ |
abbc956a |
-e VALIDATE_REPO=${GIT_URL} \
-e VALIDATE_BRANCH=${CHANGE_TARGET} \ |
b81c7624 |
docker:${GIT_COMMIT} \ |
3040f3fd |
hack/test/unit
'''
} |
c243ffaa |
post {
always {
junit testResults: 'bundles/junit-report.xml', allowEmptyResults: true
}
} |
3040f3fd |
} |
949708a7 |
stage("Validate vendor") {
steps {
sh '''
docker run --rm -t --privileged \
-v "$WORKSPACE/.git:/go/src/github.com/docker/docker/.git" \ |
cbbff330 |
--name docker-pr$BUILD_NUMBER \ |
0d0b1e77 |
-e DOCKER_EXPERIMENTAL \ |
949708a7 |
-e DOCKER_GITCOMMIT=${GIT_COMMIT} \ |
04ca2e6b |
-e DOCKER_GRAPHDRIVER \ |
abbc956a |
-e VALIDATE_REPO=${GIT_URL} \
-e VALIDATE_BRANCH=${CHANGE_TARGET} \ |
949708a7 |
docker:${GIT_COMMIT} \
hack/validate/vendor
'''
}
} |
970fb3c1 |
stage("Build e2e image") {
steps {
sh '''
echo "Building e2e image"
docker build --build-arg DOCKER_GITCOMMIT=${GIT_COMMIT} -t moby-e2e-test -f Dockerfile.e2e .
'''
}
} |
5da534d8 |
} |
3040f3fd |
|
5da534d8 |
post {
always {
sh '''
echo 'Ensuring container killed.'
docker rm -vf docker-pr$BUILD_NUMBER || true |
c6a4351e |
'''
sh ''' |
5da534d8 |
echo 'Chowning /workspace to jenkins user'
docker run --rm -v "$WORKSPACE:/workspace" busybox chown -R "$(id -u):$(id -g)" /workspace |
3040f3fd |
'''
|
2d3475ba |
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', message: 'Failed to create bundles.tar.gz') {
sh '''
bundleName=unit
echo "Creating ${bundleName}-bundles.tar.gz"
tar -czvf ${bundleName}-bundles.tar.gz bundles/junit-report.xml bundles/go-test-report.json bundles/profile.out
''' |
37536cdf |
|
2d3475ba |
archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true
} |
37536cdf |
}
cleanup {
sh 'make clean' |
5da534d8 |
deleteDir()
}
}
} |
ca22ec44 |
stage('amd64') { |
5da534d8 |
when {
beforeAgent true |
ca22ec44 |
expression { params.amd64 } |
5da534d8 |
}
agent { label 'amd64 && ubuntu-1804 && overlay2' } |
4d7721cd |
|
3040f3fd |
stages { |
337f0fc8 |
stage("Print info") {
steps {
sh 'docker version'
sh 'docker info' |
0a5ea9d3 |
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
''' |
337f0fc8 |
}
} |
3040f3fd |
stage("Build dev image") {
steps {
sh '''
# todo: include ip_vs in base image
sudo modprobe ip_vs |
45814998 |
|
b81c7624 |
docker build --force-rm --build-arg APT_MIRROR -t docker:${GIT_COMMIT} . |
3040f3fd |
'''
}
}
stage("Run tests") {
steps { |
eee3f675 |
sh '''#!/bin/bash
# bash is needed so 'jobs -p' works properly
# it also accepts setting inline envvars for functions without explicitly exporting |
d4e12315 |
set -x |
45814998 |
|
eee3f675 |
run_tests() {
[ -n "$TESTDEBUG" ] && rm= || rm=--rm;
docker run $rm -t --privileged \ |
14d561eb |
-v "$WORKSPACE/bundles/${TEST_INTEGRATION_DEST}:/go/src/github.com/docker/docker/bundles" \
-v "$WORKSPACE/bundles/dynbinary-daemon:/go/src/github.com/docker/docker/bundles/dynbinary-daemon" \ |
eee3f675 |
-v "$WORKSPACE/.git:/go/src/github.com/docker/docker/.git" \
--name "$CONTAINER_NAME" \
-e KEEPBUNDLE=1 \
-e TESTDEBUG \
-e TESTFLAGS \
-e TEST_SKIP_INTEGRATION \
-e TEST_SKIP_INTEGRATION_CLI \
-e DOCKER_GITCOMMIT=${GIT_COMMIT} \
-e DOCKER_GRAPHDRIVER \ |
75c408cb |
-e TIMEOUT \ |
abbc956a |
-e VALIDATE_REPO=${GIT_URL} \
-e VALIDATE_BRANCH=${CHANGE_TARGET} \ |
eee3f675 |
docker:${GIT_COMMIT} \
hack/make.sh \
"$1" \
test-integration
}
trap "exit" INT TERM
trap 'pids=$(jobs -p); echo "Remaining pids to kill: [$pids]"; [ -z "$pids" ] || kill $pids' EXIT
CONTAINER_NAME=docker-pr$BUILD_NUMBER
|
3040f3fd |
docker run --rm -t --privileged \
-v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
-v "$WORKSPACE/.git:/go/src/github.com/docker/docker/.git" \ |
eee3f675 |
--name ${CONTAINER_NAME}-build \ |
0d0b1e77 |
-e DOCKER_EXPERIMENTAL \ |
b81c7624 |
-e DOCKER_GITCOMMIT=${GIT_COMMIT} \ |
04ca2e6b |
-e DOCKER_GRAPHDRIVER \ |
b81c7624 |
docker:${GIT_COMMIT} \ |
63966dec |
hack/make.sh \ |
eee3f675 |
dynbinary-daemon
# flaky + integration
TEST_INTEGRATION_DEST=1 CONTAINER_NAME=${CONTAINER_NAME}-1 TEST_SKIP_INTEGRATION_CLI=1 run_tests test-integration-flaky &
# integration-cli first set |
682a4618 |
TEST_INTEGRATION_DEST=2 CONTAINER_NAME=${CONTAINER_NAME}-2 TEST_SKIP_INTEGRATION=1 TESTFLAGS="-test.run Test(DockerSuite|DockerNetworkSuite|DockerHubPullSuite|DockerRegistrySuite|DockerSchema1RegistrySuite|DockerRegistryAuthTokenSuite|DockerRegistryAuthHtpasswdSuite)/" run_tests & |
eee3f675 |
# integration-cli second set |
682a4618 |
TEST_INTEGRATION_DEST=3 CONTAINER_NAME=${CONTAINER_NAME}-3 TEST_SKIP_INTEGRATION=1 TESTFLAGS="-test.run Test(DockerSwarmSuite|DockerDaemonSuite|DockerExternalVolumeSuite)/" run_tests & |
eee3f675 |
c=0
for job in $(jobs -p); do
wait ${job} || c=$?
done
exit $c |
3040f3fd |
'''
} |
517ebe62 |
post {
always {
junit testResults: 'bundles/**/*-report.xml', allowEmptyResults: true
}
} |
3040f3fd |
} |
5da534d8 |
} |
3040f3fd |
|
5da534d8 |
post {
always {
sh '''
echo "Ensuring container killed." |
dfadf729 |
cids=$(docker ps -aq -f name=docker-pr${BUILD_NUMBER}-*)
[ -n "$cids" ] && docker rm -vf $cids || true |
c6a4351e |
'''
sh ''' |
5da534d8 |
echo "Chowning /workspace to jenkins user"
docker run --rm -v "$WORKSPACE:/workspace" busybox chown -R "$(id -u):$(id -g)" /workspace
''' |
3040f3fd |
|
2d3475ba |
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', message: 'Failed to create bundles.tar.gz') {
sh ''' |
ca22ec44 |
bundleName=amd64 |
2d3475ba |
echo "Creating ${bundleName}-bundles.tar.gz"
# exclude overlay2 directories |
517ebe62 |
find bundles -path '*/root/*overlay2' -prune -o -type f \\( -name '*-report.json' -o -name '*.log' -o -name '*.prof' -o -name '*-report.xml' \\) -print | xargs tar -czf ${bundleName}-bundles.tar.gz |
2d3475ba |
''' |
37536cdf |
|
2d3475ba |
archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true
} |
37536cdf |
}
cleanup {
sh 'make clean' |
5da534d8 |
deleteDir()
}
}
} |
ca22ec44 |
stage('s390x') { |
5da534d8 |
when {
beforeAgent true |
ca22ec44 |
expression { params.s390x } |
5da534d8 |
} |
45814998 |
agent { label 's390x-ubuntu-1804' } |
3040f3fd |
stages { |
337f0fc8 |
stage("Print info") {
steps {
sh 'docker version'
sh 'docker info' |
0a5ea9d3 |
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
''' |
337f0fc8 |
}
} |
3040f3fd |
stage("Build dev image") {
steps {
sh ''' |
646e7a52 |
docker build --force-rm --build-arg APT_MIRROR -t docker:${GIT_COMMIT} . |
3040f3fd |
'''
}
} |
62af652a |
stage("Unit tests") {
steps {
sh '''
docker run --rm -t --privileged \
-v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
--name docker-pr$BUILD_NUMBER \ |
0d0b1e77 |
-e DOCKER_EXPERIMENTAL \ |
62af652a |
-e DOCKER_GITCOMMIT=${GIT_COMMIT} \
-e DOCKER_GRAPHDRIVER \ |
abbc956a |
-e VALIDATE_REPO=${GIT_URL} \
-e VALIDATE_BRANCH=${CHANGE_TARGET} \ |
62af652a |
docker:${GIT_COMMIT} \
hack/test/unit
'''
} |
75d21796 |
post {
always {
junit testResults: 'bundles/junit-report.xml', allowEmptyResults: true
}
} |
62af652a |
}
stage("Integration tests") { |
55b938cb |
environment { TEST_SKIP_INTEGRATION_CLI = '1' } |
3040f3fd |
steps {
sh '''
docker run --rm -t --privileged \
-v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \ |
7a828295 |
--name docker-pr$BUILD_NUMBER \ |
0d0b1e77 |
-e DOCKER_EXPERIMENTAL \ |
7a828295 |
-e DOCKER_GITCOMMIT=${GIT_COMMIT} \
-e DOCKER_GRAPHDRIVER \ |
08573e29 |
-e TESTDEBUG \ |
55b938cb |
-e TEST_SKIP_INTEGRATION_CLI \ |
75c408cb |
-e TIMEOUT \ |
abbc956a |
-e VALIDATE_REPO=${GIT_URL} \
-e VALIDATE_BRANCH=${CHANGE_TARGET} \ |
7a828295 |
docker:${GIT_COMMIT} \ |
62af652a |
hack/make.sh \
dynbinary \
test-integration |
3040f3fd |
'''
} |
517ebe62 |
post {
always {
junit testResults: 'bundles/**/*-report.xml', allowEmptyResults: true
}
} |
3040f3fd |
} |
5da534d8 |
} |
3040f3fd |
|
5da534d8 |
post {
always {
sh '''
echo "Ensuring container killed." |
cbbff330 |
docker rm -vf docker-pr$BUILD_NUMBER || true |
c6a4351e |
'''
sh ''' |
5da534d8 |
echo "Chowning /workspace to jenkins user" |
b40359b5 |
docker run --rm -v "$WORKSPACE:/workspace" busybox chown -R "$(id -u):$(id -g)" /workspace |
5da534d8 |
''' |
3040f3fd |
|
2d3475ba |
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', message: 'Failed to create bundles.tar.gz') {
sh '''
bundleName=s390x-integration
echo "Creating ${bundleName}-bundles.tar.gz"
# exclude overlay2 directories |
517ebe62 |
find bundles -path '*/root/*overlay2' -prune -o -type f \\( -name '*-report.json' -o -name '*.log' -o -name '*.prof' -o -name '*-report.xml' \\) -print | xargs tar -czf ${bundleName}-bundles.tar.gz |
2d3475ba |
''' |
37536cdf |
|
2d3475ba |
archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true
} |
37536cdf |
}
cleanup {
sh 'make clean' |
5da534d8 |
deleteDir()
}
}
} |
ca22ec44 |
stage('s390x integration-cli') { |
23b7bdf7 |
when {
beforeAgent true |
a18eea27 |
not { changeRequest() } |
ca22ec44 |
expression { params.s390x } |
23b7bdf7 |
} |
45814998 |
agent { label 's390x-ubuntu-1804' } |
23b7bdf7 |
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 ''' |
646e7a52 |
docker build --force-rm --build-arg APT_MIRROR -t docker:${GIT_COMMIT} . |
23b7bdf7 |
'''
}
}
stage("Integration-cli tests") { |
55b938cb |
environment { TEST_SKIP_INTEGRATION = '1' } |
23b7bdf7 |
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 \ |
55b938cb |
-e TEST_SKIP_INTEGRATION \ |
75c408cb |
-e TIMEOUT \ |
abbc956a |
-e VALIDATE_REPO=${GIT_URL} \
-e VALIDATE_BRANCH=${CHANGE_TARGET} \ |
23b7bdf7 |
docker:${GIT_COMMIT} \
hack/make.sh \
dynbinary \
test-integration
'''
} |
517ebe62 |
post {
always {
junit testResults: 'bundles/**/*-report.xml', allowEmptyResults: true
}
} |
23b7bdf7 |
}
}
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
'''
|
2d3475ba |
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', message: 'Failed to create bundles.tar.gz') {
sh '''
bundleName=s390x-integration-cli
echo "Creating ${bundleName}-bundles.tar.gz"
# exclude overlay2 directories |
517ebe62 |
find bundles -path '*/root/*overlay2' -prune -o -type f \\( -name '*-report.json' -o -name '*.log' -o -name '*.prof' -o -name '*-report.xml' \\) -print | xargs tar -czf ${bundleName}-bundles.tar.gz |
2d3475ba |
''' |
23b7bdf7 |
|
2d3475ba |
archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true
} |
23b7bdf7 |
}
cleanup {
sh 'make clean'
deleteDir()
}
}
} |
ca22ec44 |
stage('ppc64le') { |
5da534d8 |
when {
beforeAgent true |
ca22ec44 |
expression { params.ppc64le } |
5da534d8 |
}
agent { label 'ppc64le-ubuntu-1604' } |
ca22ec44 |
// ppc64le machines run on Docker 18.06, and buildkit has some bugs on that version |
002bf380 |
environment { DOCKER_BUILDKIT = '0' } |
3040f3fd |
stages { |
337f0fc8 |
stage("Print info") {
steps {
sh 'docker version'
sh 'docker info' |
0a5ea9d3 |
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
''' |
337f0fc8 |
}
} |
3040f3fd |
stage("Build dev image") {
steps { |
646e7a52 |
sh 'docker build --force-rm --build-arg APT_MIRROR -t docker:${GIT_COMMIT} .' |
3040f3fd |
}
} |
62af652a |
stage("Unit tests") {
steps {
sh '''
docker run --rm -t --privileged \
-v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
--name docker-pr$BUILD_NUMBER \ |
0d0b1e77 |
-e DOCKER_EXPERIMENTAL \ |
62af652a |
-e DOCKER_GITCOMMIT=${GIT_COMMIT} \
-e DOCKER_GRAPHDRIVER \ |
abbc956a |
-e VALIDATE_REPO=${GIT_URL} \
-e VALIDATE_BRANCH=${CHANGE_TARGET} \ |
62af652a |
docker:${GIT_COMMIT} \
hack/test/unit
'''
} |
75d21796 |
post {
always {
junit testResults: 'bundles/junit-report.xml', allowEmptyResults: true
}
} |
62af652a |
}
stage("Integration tests") { |
46fa5a43 |
environment { TEST_SKIP_INTEGRATION_CLI = '1' } |
3040f3fd |
steps {
sh '''
docker run --rm -t --privileged \
-v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \ |
7a828295 |
--name docker-pr$BUILD_NUMBER \ |
0d0b1e77 |
-e DOCKER_EXPERIMENTAL \ |
7a828295 |
-e DOCKER_GITCOMMIT=${GIT_COMMIT} \
-e DOCKER_GRAPHDRIVER \ |
08573e29 |
-e TESTDEBUG \ |
46fa5a43 |
-e TEST_SKIP_INTEGRATION_CLI \ |
75c408cb |
-e TIMEOUT \ |
abbc956a |
-e VALIDATE_REPO=${GIT_URL} \
-e VALIDATE_BRANCH=${CHANGE_TARGET} \ |
7a828295 |
docker:${GIT_COMMIT} \ |
62af652a |
hack/make.sh \
dynbinary \
test-integration |
3040f3fd |
'''
} |
517ebe62 |
post {
always {
junit testResults: 'bundles/**/*-report.xml', allowEmptyResults: true
}
} |
3040f3fd |
} |
5da534d8 |
} |
3040f3fd |
|
5da534d8 |
post {
always {
sh '''
echo "Ensuring container killed." |
1d0821ee |
docker rm -vf docker-pr$BUILD_NUMBER || true |
c6a4351e |
'''
sh ''' |
5da534d8 |
echo "Chowning /workspace to jenkins user" |
b40359b5 |
docker run --rm -v "$WORKSPACE:/workspace" busybox chown -R "$(id -u):$(id -g)" /workspace |
5da534d8 |
''' |
3040f3fd |
|
2d3475ba |
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', message: 'Failed to create bundles.tar.gz') {
sh ''' |
ca22ec44 |
bundleName=ppc64le-integration |
2d3475ba |
echo "Creating ${bundleName}-bundles.tar.gz"
# exclude overlay2 directories |
517ebe62 |
find bundles -path '*/root/*overlay2' -prune -o -type f \\( -name '*-report.json' -o -name '*.log' -o -name '*.prof' -o -name '*-report.xml' \\) -print | xargs tar -czf ${bundleName}-bundles.tar.gz |
2d3475ba |
''' |
37536cdf |
|
2d3475ba |
archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true
} |
37536cdf |
}
cleanup {
sh 'make clean' |
5da534d8 |
deleteDir()
}
}
} |
ca22ec44 |
stage('ppc64le integration-cli') { |
10dd4a25 |
when {
beforeAgent true |
a18eea27 |
not { changeRequest() } |
ca22ec44 |
expression { params.ppc64le } |
10dd4a25 |
}
agent { label 'ppc64le-ubuntu-1604' } |
ca22ec44 |
// ppc64le machines run on Docker 18.06, and buildkit has some bugs on that version |
10dd4a25 |
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 { |
646e7a52 |
sh 'docker build --force-rm --build-arg APT_MIRROR -t docker:${GIT_COMMIT} .' |
10dd4a25 |
}
}
stage("Integration-cli tests") { |
46fa5a43 |
environment { TEST_SKIP_INTEGRATION = '1' } |
10dd4a25 |
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 \ |
46fa5a43 |
-e TEST_SKIP_INTEGRATION \ |
75c408cb |
-e TIMEOUT \ |
abbc956a |
-e VALIDATE_REPO=${GIT_URL} \
-e VALIDATE_BRANCH=${CHANGE_TARGET} \ |
10dd4a25 |
docker:${GIT_COMMIT} \
hack/make.sh \
dynbinary \
test-integration
'''
} |
517ebe62 |
post {
always {
junit testResults: 'bundles/**/*-report.xml', allowEmptyResults: true
}
} |
10dd4a25 |
}
}
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
'''
|
2d3475ba |
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', message: 'Failed to create bundles.tar.gz') {
sh ''' |
ca22ec44 |
bundleName=ppc64le-integration-cli |
2d3475ba |
echo "Creating ${bundleName}-bundles.tar.gz"
# exclude overlay2 directories |
517ebe62 |
find bundles -path '*/root/*overlay2' -prune -o -type f \\( -name '*-report.json' -o -name '*.log' -o -name '*.prof' -o -name '*-report.xml' \\) -print | xargs tar -czf ${bundleName}-bundles.tar.gz |
2d3475ba |
''' |
10dd4a25 |
|
2d3475ba |
archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true
} |
10dd4a25 |
}
cleanup {
sh 'make clean'
deleteDir()
}
}
} |
ca22ec44 |
stage('win-RS1') { |
5da534d8 |
when {
beforeAgent true |
36fc8f58 |
// Skip this stage on PRs unless the windowsRS1 checkbox is selected
anyOf {
not { changeRequest() }
expression { params.windowsRS1 }
} |
5da534d8 |
} |
33926122 |
environment {
DOCKER_BUILDKIT = '0' |
e101935a |
DOCKER_DUT_DEBUG = '1' |
33926122 |
SKIP_VALIDATION_TESTS = '1'
SOURCES_DRIVE = 'd'
SOURCES_SUBDIR = 'gopath'
TESTRUN_DRIVE = 'd' |
168e23a2 |
TESTRUN_SUBDIR = "CI" |
33926122 |
WINDOWS_BASE_IMAGE = 'mcr.microsoft.com/windows/servercore'
WINDOWS_BASE_IMAGE_TAG = 'ltsc2016'
} |
5da534d8 |
agent {
node { |
33926122 |
customWorkspace 'd:\\gopath\\src\\github.com\\docker\\docker'
label 'windows-2016' |
5da534d8 |
}
} |
3040f3fd |
stages { |
337f0fc8 |
stage("Print info") {
steps {
sh 'docker version'
sh 'docker info'
}
} |
3040f3fd |
stage("Run tests") {
steps {
powershell '''
$ErrorActionPreference = 'Stop' |
33926122 |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 |
ac62fa7a |
Invoke-WebRequest https://github.com/moby/docker-ci-zap/blob/master/docker-ci-zap.exe?raw=true -OutFile C:/Windows/System32/docker-ci-zap.exe |
33926122 |
./hack/ci/windows.ps1 |
3040f3fd |
exit $LastExitCode
'''
}
} |
5da534d8 |
} |
a365f074 |
post {
always {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', message: 'Failed to create bundles.tar.gz') {
powershell '''
$bundleName="windowsRS1-integration"
Write-Host -ForegroundColor Green "Creating ${bundleName}-bundles.zip"
# archiveArtifacts does not support env-vars to , so save the artifacts in a fixed location
Compress-Archive -Path "${env:TEMP}/CIDUT.out", "${env:TEMP}/CIDUT.err" -CompressionLevel Optimal -DestinationPath "${bundleName}-bundles.zip"
'''
archiveArtifacts artifacts: '*-bundles.zip', allowEmptyArchive: true
}
}
cleanup {
sh 'make clean'
deleteDir()
}
} |
5da534d8 |
} |
ca22ec44 |
stage('win-RS5') { |
5da534d8 |
when {
beforeAgent true
expression { params.windowsRS5 }
} |
33926122 |
environment {
DOCKER_BUILDKIT = '0' |
e101935a |
DOCKER_DUT_DEBUG = '1' |
33926122 |
SKIP_VALIDATION_TESTS = '1'
SOURCES_DRIVE = 'd'
SOURCES_SUBDIR = 'gopath'
TESTRUN_DRIVE = 'd' |
168e23a2 |
TESTRUN_SUBDIR = "CI" |
33926122 |
WINDOWS_BASE_IMAGE = 'mcr.microsoft.com/windows/servercore' |
eb7bd90a |
WINDOWS_BASE_IMAGE_TAG = 'ltsc2019' |
33926122 |
} |
5da534d8 |
agent {
node { |
33926122 |
customWorkspace 'd:\\gopath\\src\\github.com\\docker\\docker'
label 'windows-2019' |
5da534d8 |
}
} |
3040f3fd |
stages { |
337f0fc8 |
stage("Print info") {
steps {
sh 'docker version'
sh 'docker info'
}
} |
3040f3fd |
stage("Run tests") {
steps {
powershell '''
$ErrorActionPreference = 'Stop' |
ac62fa7a |
Invoke-WebRequest https://github.com/moby/docker-ci-zap/blob/master/docker-ci-zap.exe?raw=true -OutFile C:/Windows/System32/docker-ci-zap.exe |
33926122 |
./hack/ci/windows.ps1 |
3040f3fd |
exit $LastExitCode
'''
}
} |
5da534d8 |
} |
a365f074 |
post {
always {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', message: 'Failed to create bundles.tar.gz') {
powershell '''
$bundleName="windowsRS5-integration"
Write-Host -ForegroundColor Green "Creating ${bundleName}-bundles.zip"
# archiveArtifacts does not support env-vars to , so save the artifacts in a fixed location
Compress-Archive -Path "${env:TEMP}/CIDUT.out", "${env:TEMP}/CIDUT.err" -CompressionLevel Optimal -DestinationPath "${bundleName}-bundles.zip"
'''
archiveArtifacts artifacts: '*-bundles.zip', allowEmptyArchive: true
}
}
cleanup {
sh 'make clean'
deleteDir()
}
} |
5da534d8 |
} |
4d7721cd |
}
}
} |
191b0383 |
} |