-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
68 lines (60 loc) · 2.38 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
up:
@docker-compose -f docker-compose.yml up --build
destroy:
@docker-compose -f docker-compose.yml down -v
migrations:
@docker-compose -f docker-compose.yml ps | grep "web" | grep "Up" > /dev/null; \
if [ $$? -eq 0 ]; then \
docker-compose -f docker-compose.yml exec web python manage.py makemigrations; \
else \
docker-compose -f docker-compose.yml up --build -d && \
docker-compose -f docker-compose.yml exec web python manage.py makemigrations; \
fi
migrate:
@docker-compose -f docker-compose.yml ps | grep "web" | grep "Up" > /dev/null; \
if [ $$? -eq 0 ]; then \
docker-compose -f docker-compose.yml exec web python manage.py migrate; \
else \
docker-compose -f docker-compose.yml up --build -d && \
docker-compose -f docker-compose.yml exec web python manage.py migrate; \
fi
test:
@docker-compose -f docker-compose.yml ps | grep "web" | grep "Up" > /dev/null; \
if [ $$? -eq 0 ]; then \
docker-compose -f docker-compose.yml exec web pytest; \
else \
docker-compose -f docker-compose.yml up --build -d && \
docker-compose -f docker-compose.yml exec web pytest; \
fi
test_specific_file:
@docker-compose -f docker-compose.yml ps | grep "web" | grep "Up" > /dev/null; \
if [ $$? -eq 0 ]; then \
docker-compose -f docker-compose.yml exec web pytest $(path); \
else \
docker-compose -f docker-compose.yml up --build -d && \
docker-compose -f docker-compose.yml exec web pytest $(path); \
fi
isort:
@docker-compose -f docker-compose.yml ps | grep "web" | grep "Up" > /dev/null; \
if [ $$? -eq 0 ]; then \
docker-compose -f docker-compose.yml exec web isort . --profile black --skip env; \
else \
docker-compose -f docker-compose.yml up --build -d && \
docker-compose -f docker-compose.yml exec web isort . --profile black --skip env; \
fi
flake:
@docker-compose -f docker-compose.yml ps | grep "web" | grep "Up" > /dev/null; \
if [ $$? -eq 0 ]; then \
docker-compose -f docker-compose.yml exec web flake8; \
else \
docker-compose -f docker-compose.yml up --build -d && \
docker-compose -f docker-compose.yml exec web flake8; \
fi
black:
@docker-compose -f docker-compose.yml ps | grep "web" | grep "Up" > /dev/null; \
if [ $$? -eq 0 ]; then \
docker-compose -f docker-compose.yml exec web black . --exclude env; \
else \
docker-compose -f docker-compose.yml up --build -d && \
docker-compose -f docker-compose.yml exec web black . --exclude env; \
fi