-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (62 loc) · 2.42 KB
/
Makefile
File metadata and controls
76 lines (62 loc) · 2.42 KB
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
70
71
72
73
74
75
76
help:
@echo "Available commands:"
@echo " build - Build the Docker container"
@echo " build-no-cache - Build the Docker container without cache"
@echo " start - Start the Docker containers"
@echo " start-detached - Start the Docker containers in detached mode"
@echo " stop-app - Stop the App container"
@echo " start-dev-app - Start the database, and App in development mode"
@echo " stop - Stop the Docker containers"
@echo " help - Show this help message"
@echo " migration - Create a new Alembic migration with a message (message=\"Your message\")"
@echo " migrate - Run Alembic migrations in the App container"
@echo " downgrade - Downgrade to a specific Alembic migration (revision=\"specific revision\" or revision=\"head-1\" to downgrade one step or more)"
@echo " mypy - Run mypy checks"
@echo " lint - Run ruff checks"
@echo " format - Format with ruff"
build:
@echo "Building Docker container..."
docker compose build
build-no-cache:
@echo "Building Docker container without ache..."
docker compose build --no-cache
start:
@echo "Starting Docker container..."
docker compose up
start-detached:
@echo "Starting Docker container..."
docker compose up -d
stop-backend:
@echo "Stopping App container..."
docker compose stop app
start-dev-backend:
@echo "Starting Database..."
docker compose up -d db
@echo "Runing App in development mode..."
docker compose run --rm --service-ports app uvicorn src.main:app --host 0.0.0.0 --port 8000 --reload
stop:
@echo "Stopping Docker containers..."
docker compose stop
migration:
@echo "Creating new migration..."
docker compose exec app alembic revision --autogenerate -m "$(message)"
@echo "Migration created successfully."
migrate:
@echo "Running Alembic migrations..."
docker compose exec app alembic upgrade head
downgrade:
@echo "Running Alembic downgrade..."
docker compose exec app alembic downgrade $(revision)
@echo "Downgrade completed."
mypy:
@echo "Running mypy checks..."
mypy
@echo "Mypy check completed."
lint:
@echo "Running ruff checks..."
ruff check src/
@echo "Ruff check completed."
format:
@echo "Formating with ruff..."
ruff format src/
@echo "Formating with ruff completed."