-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (25 loc) · 991 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
36
.PHONY: test
test:
make import_db && docker compose exec python bash -c 'make test_command_python'
linter:
docker compose exec python pylint --rcfile=standard.rc src/ ./app.py
start:
docker compose up
python:
docker compose exec python bash
mysql:
docker compose exec mysql bash -c 'mysql -u game -pazerty games'
import_db:
docker compose exec mysql bash -c 'cd /code && make import_db_command'
export_db:
docker compose exec mysql bash -c 'cd /code && mysqldump -u game -pazerty games > test/games_test.sql'
# updates the requirements from PIPENV (need to rebuild the pyton container after that)
requirements:
docker compose exec python bash -c "cd docker/python && pipenv lock -r > ./requirements.txt"
## Containers internal command
import_db_command:
mysql -u game -pazerty games < test/games_test.sql
test_command_python:
python -m unittest discover .
migration:
docker compose exec mysql bash -c 'cd /code && mysql -u game -pazerty games < migrations/${FILE}.sql'