-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
46 lines (38 loc) · 971 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
37
38
39
40
41
42
43
44
45
46
.PHONY: environment
environment:
pyenv install -s 3.10.0
pyenv uninstall --force user-manager
pyenv virtualenv 3.10.0 --force user-manager
pyenv local user-manager
.PHONY: install
install:
pip freeze | xargs -r pip uninstall -y
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pre-commit install
.PHONY: db_init
db_init:
docker-compose up -d database
.PHONY: db_generate_migration
db_generate_migration: db_run_migrations
PYTHONPATH=. \
alembic revision --autogenerate -m "$(description)"
.PHONY: db_run_migrations
db_run_migrations: db_init
PYTHONPATH=. \
alembic upgrade head
.PHONY: cache_init
cache_init:
docker-compose up -d cache
.PHONY: broker_init
broker_init:
docker-compose up -d broker \
|| echo "Could not start broker"
.PHONY: test
test:
docker-compose down && \
PYTHONPATH=. \
python -m pytest --cov=app -s
.PHONY: run
run: db_run_migrations cache_init broker_init
uvicorn --reload --port=8001 app.run:api