Skip to content

Commit c15ee39

Browse files
authored
Merge pull request #2764 from StefanScherer/clean-home-docker
Use DOCKER_CONFIG to have creds in dind environment
2 parents 407dcfd + 00da4dc commit c15ee39

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Jenkinsfile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ def runTests = { Map settings ->
8585
def testNetwork = "dpy-testnet-\$BUILD_NUMBER-\$EXECUTOR_NUMBER-${pythonVersion}-${dockerVersion}"
8686
withDockerRegistry(credentialsId:'dockerbuildbot-index.docker.io') {
8787
try {
88+
// unit tests
89+
sh """docker run --rm \\
90+
-e 'DOCKER_TEST_API_VERSION=${apiVersion}' \\
91+
${testImage} \\
92+
py.test -v -rxs --cov=docker tests/unit
93+
"""
94+
// integration tests
8895
sh """docker network create ${testNetwork}"""
8996
sh """docker run --rm -d --name ${dindContainerName} -v /tmp --privileged --network ${testNetwork} \\
9097
${imageDindSSH} dockerd -H tcp://0.0.0.0:2375
@@ -95,9 +102,9 @@ def runTests = { Map settings ->
95102
-e 'DOCKER_TEST_API_VERSION=${apiVersion}' \\
96103
--network ${testNetwork} \\
97104
--volumes-from ${dindContainerName} \\
98-
-v ~/.docker/config.json:/root/.docker/config.json \\
105+
-v $DOCKER_CONFIG/config.json:/root/.docker/config.json \\
99106
${testImage} \\
100-
py.test -v -rxs --cov=docker --ignore=tests/ssh tests/
107+
py.test -v -rxs --cov=docker tests/integration
101108
"""
102109
sh """docker stop ${dindContainerName}"""
103110
// start DIND container with SSH
@@ -111,7 +118,7 @@ def runTests = { Map settings ->
111118
-e 'DOCKER_TEST_API_VERSION=${apiVersion}' \\
112119
--network ${testNetwork} \\
113120
--volumes-from ${dindContainerName} \\
114-
-v ~/.docker/config.json:/root/.docker/config.json \\
121+
-v $DOCKER_CONFIG/config.json:/root/.docker/config.json \\
115122
${testImage} \\
116123
py.test -v -rxs --cov=docker tests/ssh
117124
"""

0 commit comments

Comments
 (0)