-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
55 lines (44 loc) · 1.04 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
PACKAGE_DIRECTORY := .
CACHE_DIRECTORY := .cache
# Clean the cache directory
.PHONY: clean
clean:
rm --force --recursive "${CACHE_DIRECTORY}"
rm --force --recursive `find . -type d -name __pycache__`
# Linting commands
.PHONY: lint
lint:
@poetry run mypy ${PACKAGE_DIRECTORY}
@poetry run ruff check ${PACKAGE_DIRECTORY}
@poetry run ruff format --check ${PACKAGE_DIRECTORY}
.PHONY: format
format:
@poetry run ruff format ${PACKAGE_DIRECTORY}
@poetry run ruff check --fix ${PACKAGE_DIRECTORY}
# Migration commands
.PHONY: migration
migration:
poetry run alembic revision --autogenerate -m $(name) --rev-id $(rev_id)
.PHONY: migrate
migrate:
poetry run alembic upgrade head
# Docker commands
.PHONY: app-build
app-build:
docker-compose build
.PHONY: app-run
app-run:
docker-compose stop
docker-compose up -d --remove-orphans
.PHONY: app-stop
app-stop:
docker-compose stop
.PHONY: app-down
app-down:
docker-compose down
.PHONY: app-destroy
app-destroy:
docker-compose down -v --remove-orphans
.PHONY: app-logs
app-logs:
docker-compose logs -f bot