-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (41 loc) · 1.54 KB
/
Makefile
File metadata and controls
55 lines (41 loc) · 1.54 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
ifndef BUILD_TAG
BUILD_TAG = git-$(shell git rev-parse --short HEAD)
endif
COMPONENT = workflow
IMAGE = $(IMAGE_PREFIX)$(COMPONENT):$(BUILD_TAG)
SHELL_SCRIPTS = $(wildcard rootfs/bin/*) $(shell find "rootfs" -name '*.sh')
check-docker:
@if [ -z $$(which docker) ]; then \
echo "Missing \`docker\` client which is required for development"; \
exit 2; \
fi
build: docker-build
docker-build: check-docker
docker build --rm -t $(IMAGE) rootfs
docker-push:
docker push ${IMAGE}
clean: check-docker
docker rmi $(IMAGE)
commit-hook:
cp contrib/util/commit-msg .git/hooks/commit-msg
full-clean: check-docker
docker images -q $(IMAGE_PREFIX)$(COMPONENT) | xargs docker rmi -f
postgres:
docker start postgres || docker run --restart="always" -d -p 5432:5432 --name postgres postgres:9.3
docker exec postgres createdb -U postgres deis 2>/dev/null || true
@echo "To use postgres for local development:"
@echo " export PGHOST=`docker-machine ip $$(docker-machine active) 2>/dev/null || echo 127.0.0.1`"
@echo " export PGPORT=5432"
@echo " export PGUSER=postgres"
setup-venv:
@if [ ! -d venv ]; then virtualenv venv; fi
venv/bin/pip install --disable-pip-version-check -q -r rootfs/requirements.txt -r rootfs/dev_requirements.txt
test: test-style test-unit
test-unit:
cd rootfs \
&& coverage run manage.py test --noinput web registry api \
&& coverage report -m
test-style:
cd rootfs && flake8 --show-pep8 --show-source
shellcheck $(SHELL_SCRIPTS)
.PHONY: build clean commit-hook full-clean postgres setup-venv test test-unit test-style