summaryrefslogtreecommitdiff
path: root/Makefile
blob: 30421e506cc7f5c556775e649ad6bf3d1b990342 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
.PHONY: all build test integration-test unit-test build-py3 unit-test-py3 integration-test-py3

all: test

clean:
	docker rm -vf dpy-dind

build:
	docker build -t docker-py .

build-py3:
	docker build -t docker-py3 -f Dockerfile-py3 .

test: flake8 unit-test unit-test-py3 integration-dind

unit-test: build
	docker run docker-py py.test tests/test.py tests/utils_test.py

unit-test-py3: build-py3
	docker run docker-py3 py.test tests/test.py tests/utils_test.py

integration-test: build
	docker run -v /var/run/docker.sock:/var/run/docker.sock docker-py py.test tests/integration_test.py

integration-test-py3: build-py3
	docker run -v /var/run/docker.sock:/var/run/docker.sock docker-py3 py.test tests/integration_test.py

integration-dind: build build-py3
	docker run -d --name dpy-dind --privileged dockerswarm/dind:1.8.1 docker -d -H tcp://0.0.0.0:2375
	docker run --env="DOCKER_HOST=tcp://docker:2375" --link=dpy-dind:docker docker-py py.test tests/integration_test.py
	docker run --env="DOCKER_HOST=tcp://docker:2375" --link=dpy-dind:docker docker-py3 py.test tests/integration_test.py
	docker rm -vf dpy-dind

flake8: build
	docker run docker-py flake8 docker tests