forked from watchdogpolska/small_eod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
69 lines (47 loc) · 1.91 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
69
.PHONY: all test clean docs
TEST?=small_eod
start: wait_mysql wait_minio
docker-compose up -d
stop:
docker-compose stop
logs:
docker-compose logs --tail 100 -f
clean:
docker-compose down
build:
docker-compose build backend
test: wait_mysql wait_minio test-django-backend test-openapi-spec
test-django-backend:
docker-compose run backend python manage.py test --keepdb --verbosity=2 ${TEST}
test-openapi-spec:
docker-compose run --rm backend python manage.py generate_swagger --format json -o openapi.json
docker run -v $$(pwd)/backend-project/openapi.json:/openapi.json --rm p1c2u/openapi-spec-validator --schema 2.0 /openapi.json
docker-compose run --rm backend rm openapi.json
wait_mysql:
docker-compose up -d db
docker-compose run --rm backend bash -c 'wait-for-it db:5432'
wait_minio:
docker-compose up -d minio
docker-compose run --rm backend bash -c 'wait-for-it minio:9000'
migrate:
docker-compose run --rm backend python manage.py migrate
makemigrations:
docker-compose run --rm backend python manage.py makemigrations
pyupgrade:
docker run --rm -v /$$(pwd)/backend-project:/data quay.io/watchdogpolska/pyupgrade --py37-plus
lint:
docker run --rm -v /$$(pwd)/backend-project:/apps alpine/flake8 .
docker run --rm -v /$$(pwd)/backend-project:/data cytopia/black --check .
fmt:
docker run --rm -v /$$(pwd):/data cytopia/black ./backend-project
check: wait_mysql wait_minio
docker-compose run --rm backend python manage.py makemigrations --check
migrations: wait_mysql wait_minio
docker-compose run --rm backend python manage.py makemigrations
settings:
docker-compose run --rm backend python manage.py diffsettings
createsuperuser: wait_minio
docker-compose run --rm -e DJANGO_SUPERUSER_PASSWORD=root backend python manage.py createsuperuser --username root --email root@example.com --noinput
test-local: lint build check test
openapi:
docker-compose run --rm backend python manage.py generate_swagger