-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (26 loc) · 783 Bytes
/
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
# define the name of the virtual environment directory
app_name = todo_flask
VENV := .venv
# default target, when make executed without arguments
init: venv
$(VENV)/bin/activate: requirements.txt
python3 -m venv $(VENV)
./$(VENV)/bin/pip install -r requirements.txt
# venv is a shortcut target
venv: $(VENV)/bin/activate
test:
rm -rf ./tmp/*
python -m pytest -v
pytest --cov-report term-missing --cov='./app'
clean:
rm -rf $(VENV)
find . -type f -name '*.pyc' -delete
build:
@docker build -t $(app_name) .
run:
@docker run --detach -p 5000:5000 --env MONGO_CONN_STR --name $(app_name) $(app_name)
kill:
@echo 'Killing container...'
@docker rm -f $(app_name)
# @docker ps | grep $(app_name) | awk '{print $1}' | xargs docker rm -f
.PHONY: init venv test run clean