forked from kmikkel/elasticsearch-workshop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (38 loc) · 1.15 KB
/
Makefile
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
PROJECT_NAME = bigone
API_SERVICE = api
BUILD_DIR = build
REPORTS_DIR = reports
DOCKER_COMPOSE = docker-compose -p $(PROJECT_NAME)
DOCKER_RUN = $(DOCKER_COMPOSE) run --rm $(API_SERVICE)
DOCKER_RUN_API_ONLY = $(DOCKER_COMPOSE) run --rm --no-deps -e ELASTICSEARCH_URL='' $(API_SERVICE)
DOCKER_RUN_TESTS = $(DOCKER_COMPOSE) run --rm -e ENVIRONMENT='testing' $(API_SERVICE)
# Build / clean
build: .
$(DOCKER_COMPOSE) build
pyclean: build
$(DOCKER_RUN_API_ONLY) find . -name "*.pyc" -delete
clean: pyclean
$(DOCKER_RUN_API_ONLY) rm $(BUILD_DIR)/*
$(DOCKER_RUN_API_ONLY) rm $(REPORTS_DIR)/*
# Docker Compose aliases
rm: stop
$(DOCKER_COMPOSE) rm -f
ps:
$(DOCKER_COMPOSE) ps
logs:
$(DOCKER_COMPOSE) logs
# Test
nosetests: pyclean
$(DOCKER_RUN_API_ONLY) nosetests \
--where=tests_unit \
--debug \
--no-byte-compile \
--with-xcoverage \
--xcoverage-file=build/coverage.xml \
--with-xunit \
--xunit-file=build/nosetests.xml \
--cover-erase \
--cover-package=.
# Workshop
run-tasks: pyclean
$(DOCKER_RUN_TESTS) behave -v --format=json.pretty --color --junit --outfile=build/behave-results.json