Skip to content

Commit

Permalink
Merge pull request #2764 from StefanScherer/clean-home-docker
Browse files Browse the repository at this point in the history
Use DOCKER_CONFIG to have creds in dind environment
  • Loading branch information
aiordache committed Feb 11, 2021
2 parents 407dcfd + 00da4dc commit c15ee39
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
"""
Expand Down

0 comments on commit c15ee39

Please sign in to comment.