diff options
author | Anca Iordache <aiordache@users.noreply.github.com> | 2021-02-11 20:31:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-11 20:31:13 +0100 |
commit | c15ee3925d39ce8b845fb68aa8156153c5f6c352 (patch) | |
tree | 1d249d69fea78f9480e8accd2f7eddb69a0401c7 | |
parent | 407dcfd65ba81e8974c3dab5dd9499014e0f8b7f (diff) | |
parent | 00da4dc0eae7d491c16384077f4d4da9a58836b1 (diff) | |
download | docker-py-c15ee3925d39ce8b845fb68aa8156153c5f6c352.tar.gz |
Merge pull request #2764 from StefanScherer/clean-home-docker
Use DOCKER_CONFIG to have creds in dind environment
-rw-r--r-- | Jenkinsfile | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Jenkinsfile b/Jenkinsfile index e7c3321..471072b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -85,6 +85,13 @@ def runTests = { Map settings -> def testNetwork = "dpy-testnet-\$BUILD_NUMBER-\$EXECUTOR_NUMBER-${pythonVersion}-${dockerVersion}" withDockerRegistry(credentialsId:'dockerbuildbot-index.docker.io') { try { + // unit tests + sh """docker run --rm \\ + -e 'DOCKER_TEST_API_VERSION=${apiVersion}' \\ + ${testImage} \\ + py.test -v -rxs --cov=docker tests/unit + """ + // integration tests sh """docker network create ${testNetwork}""" sh """docker run --rm -d --name ${dindContainerName} -v /tmp --privileged --network ${testNetwork} \\ ${imageDindSSH} dockerd -H tcp://0.0.0.0:2375 @@ -95,9 +102,9 @@ def runTests = { Map settings -> -e 'DOCKER_TEST_API_VERSION=${apiVersion}' \\ --network ${testNetwork} \\ --volumes-from ${dindContainerName} \\ - -v ~/.docker/config.json:/root/.docker/config.json \\ + -v $DOCKER_CONFIG/config.json:/root/.docker/config.json \\ ${testImage} \\ - py.test -v -rxs --cov=docker --ignore=tests/ssh tests/ + py.test -v -rxs --cov=docker tests/integration """ sh """docker stop ${dindContainerName}""" // start DIND container with SSH @@ -111,7 +118,7 @@ def runTests = { Map settings -> -e 'DOCKER_TEST_API_VERSION=${apiVersion}' \\ --network ${testNetwork} \\ --volumes-from ${dindContainerName} \\ - -v ~/.docker/config.json:/root/.docker/config.json \\ + -v $DOCKER_CONFIG/config.json:/root/.docker/config.json \\ ${testImage} \\ py.test -v -rxs --cov=docker tests/ssh """ |