-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (37 loc) · 1.49 KB
/
Makefile
File metadata and controls
45 lines (37 loc) · 1.49 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
.PHONY: help run stop test test-unit test-integration clean migrations
help:
@echo "Available commands:"
@echo " run - Run the application (development with auto-reload, debug mode)"
@echo " stop - Stop the application"
@echo " test - Run all tests"
@echo " test-unit - Run unit tests"
@echo " test-integration - Run integration tests with fresh database"
@echo " clean - Clean up Docker containers and volumes"
@echo " migrations msg - Generate alembic migration via Docker (e.g. make migrations msg='add cancelled status')"
run:
docker compose up --build -d
@echo "Application running at http://localhost:8000"
@echo "Swagger UI is available at http://localhost:8000/docs"
stop:
@echo "Stopping the application..."
docker compose stop
test:
$(MAKE) test-unit
$(MAKE) test-integration
test-unit:
@echo "Running unit tests..."
docker build -t python-fastapi-example-oms-app:latest .
docker run --rm --tty -e AUTH_JWT_SECRET_KEY=docker-unit-tests-key python-fastapi-example-oms-app:latest python -m pytest tests/unit/ -v
test-integration:
$(MAKE) clean
$(MAKE) run
@echo "Running integration tests..."
docker compose run --rm app python -m pytest tests/integration/ -v
$(MAKE) clean
migrations:
@if [ -z "$(msg)" ]; then echo "Usage: make migrations msg='your message'"; exit 1; fi
docker compose run --rm app alembic revision --autogenerate -m "$(msg)"
clean:
$(MAKE) stop
@echo "Cleaning all data..."
docker compose down -v