summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Firshman <ben@firshman.co.uk>2016-09-08 09:10:27 +0100
committerBen Firshman <ben@firshman.co.uk>2016-09-08 15:42:44 +0100
commit06489235964470c9fdb12ec3a30e82aaa9586a28 (patch)
treebce4de1a3600489803c95b1e55c3973ee256b7cc
parent717ec945db102be44d31bba94c4253fc1501b3a0 (diff)
downloaddocker-py-06489235964470c9fdb12ec3a30e82aaa9586a28.tar.gz
Add .PHONY for each makefile instruction
Makes it much easier to keep this maintained properly. See also: http://clarkgrubb.com/makefile-style-guide#phony-targets Replaces #1164 Signed-off-by: Ben Firshman <ben@firshman.co.uk>
-rw-r--r--Makefile17
1 files changed, 15 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 5083b79..1fb21d4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,37 +1,47 @@
-.PHONY: all build test integration-test unit-test build-py3 unit-test-py3 integration-test-py3
-
+.PHONY: all
all: test
+.PHONY: clean
clean:
-docker rm -vf dpy-dind
find -name "__pycache__" | xargs rm -rf
+.PHONY: build
build:
docker build -t docker-py .
+.PHONY: build-py3
build-py3:
docker build -t docker-py3 -f Dockerfile-py3 .
+.PHONY: build-docs
build-docs:
docker build -t docker-py-docs -f Dockerfile-docs .
+.PHONY: build-dind-certs
build-dind-certs:
docker build -t dpy-dind-certs -f tests/Dockerfile-dind-certs .
+.PHONY: test
test: flake8 unit-test unit-test-py3 integration-dind integration-dind-ssl
+.PHONY: unit-test
unit-test: build
docker run docker-py py.test tests/unit
+.PHONY: unit-test-py3
unit-test-py3: build-py3
docker run docker-py3 py.test tests/unit
+.PHONY: integration-test
integration-test: build
docker run -v /var/run/docker.sock:/var/run/docker.sock docker-py py.test tests/integration
+.PHONY: integration-test-py3
integration-test-py3: build-py3
docker run -v /var/run/docker.sock:/var/run/docker.sock docker-py3 py.test tests/integration
+.PHONY: integration-dind
integration-dind: build build-py3
docker rm -vf dpy-dind || :
docker run -d --name dpy-dind --privileged dockerswarm/dind:1.12.0 docker daemon\
@@ -42,6 +52,7 @@ integration-dind: build build-py3
py.test tests/integration
docker rm -vf dpy-dind
+.PHONY: integration-dind-ssl
integration-dind-ssl: build-dind-certs build build-py3
docker run -d --name dpy-dind-certs dpy-dind-certs
docker run -d --env="DOCKER_HOST=tcp://localhost:2375" --env="DOCKER_TLS_VERIFY=1"\
@@ -57,8 +68,10 @@ integration-dind-ssl: build-dind-certs build build-py3
--link=dpy-dind-ssl:docker docker-py3 py.test tests/integration
docker rm -vf dpy-dind-ssl dpy-dind-certs
+.PHONY: flake8
flake8: build
docker run docker-py flake8 docker tests
+.PHONY: docs
docs: build-docs
docker run -v `pwd`/docs:/home/docker-py/docs/ -p 8000:8000 docker-py-docs mkdocs serve -a 0.0.0.0:8000