-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
63 lines (52 loc) · 1.49 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
.PHONY: help
help:
@echo "USAGE"
@echo " make <commands>"
@echo ""
@echo "AVAILABLE COMMANDS"
@echo " ref Reformat code"
@echo " http Start the HTTP app"
@echo " amqp Start the AMQP app"
@echo " scheduler Start the Scheduler app"
@echo " tests Start the pytest tests"
@echo " docker Docker container build"
@echo " docker-tests Tests docker container build"
@echo " migrate Alembic migrate database"
@echo " generate Alembic generate database"
@echo " req pyproject.toml >> requirements.txt"
.PHONY: ref
ref:
poetry run pre-commit run --all-files
.PHONY: http
http:
set -a; source .env; set +a; \
poetry run uvicorn app:http --limit-concurrency 1000 --reload
.PHONY: amqp
amqp:
set -a; source .env; set +a; \
poetry run faststream run app:amqp --reload
.PHONY: scheduler
scheduler:
set -a; source .env; set +a; \
poetry run taskiq scheduler app:scheduler
.PHONY: tests
tests:
set -a; source .env; source .env.tests; set +a; \
poetry run pytest
.PHONY: docker
docker:
docker-compose up -d --build
.PHONY: docker-tests
docker-tests:
docker-compose -f docker-compose-tests.yaml up --exit-code-from tests
.PHONY: migrate
migrate:
set -a; source .env; set +a; \
poetry run alembic upgrade head
.PHONY: generate
generate:
set -a; source .env; set +a; \
poetry run alembic revision --autogenerate
.PHONY: req
req:
@poetry export --without-hashes --without-urls | sed 's/;.*//' | tee requirements.txt