|
1 | 1 | include ../includes.mk |
2 | 2 |
|
3 | | -.PHONY: all test logs |
4 | | - |
5 | | -all: build run |
6 | | - |
7 | | -SHELL_SCRIPTS = $(wildcard bin/*) $(shell find "." -name '*.sh') |
8 | | - |
9 | 3 | COMPONENT = controller |
10 | 4 | IMAGE = $(IMAGE_PREFIX)$(COMPONENT):$(BUILD_TAG) |
11 | | -DEV_IMAGE = $(REGISTRY)$(IMAGE) |
| 5 | +SHELL_SCRIPTS = $(wildcard bin/*) $(shell find "." -name '*.sh') |
12 | 6 |
|
13 | 7 | build: check-docker |
14 | 8 | docker build -t $(IMAGE) . |
15 | 9 |
|
16 | | -clean: check-docker check-registry |
| 10 | +clean: check-docker |
17 | 11 | docker rmi $(IMAGE) |
18 | 12 |
|
19 | | -full-clean: check-docker check-registry |
| 13 | +full-clean: check-docker |
20 | 14 | docker images -q $(IMAGE_PREFIX)$(COMPONENT) | xargs docker rmi -f |
21 | 15 |
|
22 | | -install: check-deisctl |
23 | | - deisctl install $(COMPONENT) |
24 | | - |
25 | | -uninstall: check-deisctl |
26 | | - deisctl uninstall $(COMPONENT) |
27 | | - |
28 | | -start: check-deisctl |
29 | | - deisctl start $(COMPONENT) |
30 | | - |
31 | | -stop: check-deisctl |
32 | | - deisctl stop $(COMPONENT) |
33 | | - |
34 | | -restart: stop start |
35 | | - |
36 | | -run: install start |
37 | | - |
38 | | -dev-release: push set-image |
39 | | - |
40 | | -push: check-registry |
41 | | - docker tag -f $(IMAGE) $(DEV_IMAGE) |
42 | | - docker push $(DEV_IMAGE) |
43 | | - |
44 | | -set-image: check-deisctl |
45 | | - deisctl config $(COMPONENT) set image=$(DEV_IMAGE) |
46 | | - |
47 | | -release: |
48 | | - docker push $(IMAGE) |
49 | | - |
50 | | -deploy: build dev-release restart |
51 | | - |
52 | | -runserver: |
53 | | - python manage.py runserver |
54 | | - |
55 | 16 | postgres: |
56 | | - docker start postgres || docker run --restart="always" -d -p 5432:5432 --name postgres postgres:9.4.1 |
| 17 | + docker start postgres || docker run --restart="always" -d -p 5432:5432 --name postgres postgres:9.3 |
57 | 18 | docker exec postgres createdb -U postgres deis 2>/dev/null || true |
58 | 19 | @echo "To use postgres for local development:" |
59 | 20 | @echo " export PGHOST=`docker-machine ip $$(docker-machine active) 2>/dev/null || echo 127.0.0.1`" |
60 | 21 | @echo " export PGPORT=5432" |
61 | 22 | @echo " export PGUSER=postgres" |
62 | 23 |
|
63 | | -db: |
64 | | - python manage.py syncdb --migrate --noinput |
65 | | - |
66 | | -coverage: |
67 | | - coverage run manage.py test --noinput api |
68 | | - coverage html |
69 | | - |
70 | | -test: test-unit test-functional |
71 | | - |
72 | 24 | setup-venv: |
73 | 25 | @if [ ! -d venv ]; then virtualenv venv; fi |
74 | 26 | venv/bin/pip install --disable-pip-version-check -q -r requirements.txt -r dev_requirements.txt |
75 | 27 |
|
76 | | -test-style: setup-venv |
77 | | - venv/bin/flake8 --show-pep8 --show-source |
| 28 | +test: test-style test-unit |
| 29 | + |
| 30 | +test-style: |
| 31 | + flake8 --show-pep8 --show-source |
78 | 32 | shellcheck $(SHELL_SCRIPTS) |
79 | 33 |
|
80 | | -test-unit: setup-venv test-style |
81 | | - venv/bin/coverage run manage.py test --noinput web registry api |
82 | | - venv/bin/coverage report -m |
| 34 | +test-unit: |
| 35 | + coverage run manage.py test --noinput web registry api |
| 36 | + coverage report -m |
83 | 37 |
|
84 | | -test-functional: |
85 | | - @$(MAKE) -C ../tests/ test-etcd |
86 | | - @$(MAKE) -C ../tests/ test-postgresql |
87 | | - GOPATH=`cd ../tests/ && godep path`:$(GOPATH) go test -v ./tests/... |
| 38 | +.PHONY: build clean full-clean postgres setup-venv test test-style test-unit |
0 commit comments