summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile36
1 files changed, 21 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index f491993..434d40e 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@ all: test
.PHONY: clean
clean:
- -docker rm -f dpy-dind-py2 dpy-dind-py3
+ -docker rm -f dpy-dind-py2 dpy-dind-py3 dpy-dind-certs dpy-dind-ssl
find -name "__pycache__" | xargs rm -rf
.PHONY: build
@@ -44,41 +44,47 @@ integration-test-py3: build-py3
TEST_API_VERSION ?= 1.35
TEST_ENGINE_VERSION ?= 17.12.0-ce
+.PHONY: setup-network
+setup-network:
+ docker network inspect dpy-tests || docker network create dpy-tests
+
.PHONY: integration-dind
integration-dind: integration-dind-py2 integration-dind-py3
.PHONY: integration-dind-py2
-integration-dind-py2: build
+integration-dind-py2: build setup-network
docker rm -vf dpy-dind-py2 || :
- docker run -d --name dpy-dind-py2 --privileged dockerswarm/dind:${TEST_ENGINE_VERSION} dockerd\
- -H tcp://0.0.0.0:2375 --experimental
- docker run -t --rm --env="DOCKER_HOST=tcp://docker:2375" --env="DOCKER_TEST_API_VERSION=${TEST_API_VERSION}"\
- --link=dpy-dind-py2:docker docker-sdk-python py.test tests/integration
+ docker run -d --network dpy-tests --name dpy-dind-py2 --privileged\
+ dockerswarm/dind:${TEST_ENGINE_VERSION} dockerd -H tcp://0.0.0.0:2375 --experimental
+ docker run -t --rm --env="DOCKER_HOST=tcp://dpy-dind-py2:2375" --env="DOCKER_TEST_API_VERSION=${TEST_API_VERSION}"\
+ --network dpy-tests docker-sdk-python py.test tests/integration
docker rm -vf dpy-dind-py2
.PHONY: integration-dind-py3
-integration-dind-py3: build-py3
+integration-dind-py3: build-py3 setup-network
docker rm -vf dpy-dind-py3 || :
- docker run -d --name dpy-dind-py3 --privileged dockerswarm/dind:${TEST_ENGINE_VERSION} dockerd\
- -H tcp://0.0.0.0:2375 --experimental
- docker run -t --rm --env="DOCKER_HOST=tcp://docker:2375" --env="DOCKER_TEST_API_VERSION=${TEST_API_VERSION}"\
- --link=dpy-dind-py3:docker docker-sdk-python3 py.test tests/integration
+ docker run -d --network dpy-tests --name dpy-dind-py3 --privileged\
+ dockerswarm/dind:${TEST_ENGINE_VERSION} dockerd -H tcp://0.0.0.0:2375 --experimental
+ docker run -t --rm --env="DOCKER_HOST=tcp://dpy-dind-py3:2375" --env="DOCKER_TEST_API_VERSION=${TEST_API_VERSION}"\
+ --network dpy-tests docker-sdk-python3 py.test tests/integration
docker rm -vf dpy-dind-py3
.PHONY: integration-dind-ssl
integration-dind-ssl: build-dind-certs build build-py3
+ docker rm -vf dpy-dind-certs dpy-dind-ssl || :
docker run -d --name dpy-dind-certs dpy-dind-certs
docker run -d --env="DOCKER_HOST=tcp://localhost:2375" --env="DOCKER_TLS_VERIFY=1"\
--env="DOCKER_CERT_PATH=/certs" --volumes-from dpy-dind-certs --name dpy-dind-ssl\
- -v /tmp --privileged dockerswarm/dind:${TEST_ENGINE_VERSION} dockerd --tlsverify\
- --tlscacert=/certs/ca.pem --tlscert=/certs/server-cert.pem\
+ --network dpy-tests --network-alias docker -v /tmp --privileged\
+ dockerswarm/dind:${TEST_ENGINE_VERSION}\
+ dockerd --tlsverify --tlscacert=/certs/ca.pem --tlscert=/certs/server-cert.pem\
--tlskey=/certs/server-key.pem -H tcp://0.0.0.0:2375 --experimental
docker run -t --rm --volumes-from dpy-dind-ssl --env="DOCKER_HOST=tcp://docker:2375"\
--env="DOCKER_TLS_VERIFY=1" --env="DOCKER_CERT_PATH=/certs" --env="DOCKER_TEST_API_VERSION=${TEST_API_VERSION}"\
- --link=dpy-dind-ssl:docker docker-sdk-python py.test tests/integration
+ --network dpy-tests docker-sdk-python py.test tests/integration
docker run -t --rm --volumes-from dpy-dind-ssl --env="DOCKER_HOST=tcp://docker:2375"\
--env="DOCKER_TLS_VERIFY=1" --env="DOCKER_CERT_PATH=/certs" --env="DOCKER_TEST_API_VERSION=${TEST_API_VERSION}"\
- --link=dpy-dind-ssl:docker docker-sdk-python3 py.test tests/integration
+ --network dpy-tests docker-sdk-python3 py.test tests/integration
docker rm -vf dpy-dind-ssl dpy-dind-certs
.PHONY: flake8