-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
59 lines (42 loc) · 1.55 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
.PHONY: help up down init-db logs status admin-ui install start-local prepare-test test coverage lint lint-fix format
run-docker-compose = docker compose -f docker-compose.yml
server_port = 3000
default: help
help: # Show help for each of the Makefile recipes.
@grep -E '^[a-zA-Z0-9 -]+:.*#' Makefile | sort | while read -r l; do printf "\033[1;32m$$(echo $$l | cut -f 1 -d':')\033[00m:$$(echo $$l | cut -f 2- -d'#')\n"; done
up: # Start containers and tail logs
$(run-docker-compose) up -d
down: # Stop all containers
$(run-docker-compose) down --remove-orphans
init-db: # Initialize the database and load fixtures
$(run-docker-compose) --profile dev up -d
logs: # Tail container logs
$(run-docker-compose) logs -f dynamodb-local
status: # Show status of all containers
$(run-docker-compose) ps
admin-ui: # Open the UI in the browser
open http://localhost:8001
install: # Install dependencies
poetry install --no-root
@if [ ! -f .env.dev ]; then \
cp .env.example .env.dev; \
fi
start-local: # Start the local server
poetry run uvicorn app.main:app --reload --port $(server_port)
prepare-test: # Prepare test environment
$(run-docker-compose) --profile test up -d
sleep 5
test: prepare-test # Run tests
ifdef filter
poetry run pytest $(filter) -vv
else
poetry run pytest -n 4 -vv
endif
coverage: test # Run tests with coverage
poetry run pytest -n 4 --cov-report term-missing --cov=app
lint: # Run linter
poetry run ruff check .
lint-fix: # Run linter with fix
poetry run ruff check --fix .
format: # Run formatter
poetry run ruff format .