-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (43 loc) · 1.97 KB
/
Makefile
File metadata and controls
64 lines (43 loc) · 1.97 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
COMPOSE_PROD := docker compose -f compose.yaml
COMPOSE_DEV := $(COMPOSE_PROD) -f compose-dev.yaml
RUN := $(COMPOSE_DEV) run --rm app
.DEFAULT_GOAL := help
.PHONY: help dev-build dev-run dev-shell dev-psql prod-run worker-shell redis-cli db-upgrade db-downgrade db-migrate db-history format lint lint-fix type-check css-build test test-cov
help: ## Show this help
@awk 'BEGIN {FS = ":.*?## "; printf "Usage: make <target>\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?## / {printf " \033[36m%-12s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
dev-build: ## Build the dev container image
$(COMPOSE_DEV) build
dev-run: ## Run the app in foreground (http://localhost:5009)
$(COMPOSE_DEV) up
prod-run: ## Run the prod stack in foreground (pulls ghcr.io/netways/struudel:latest)
$(COMPOSE_PROD) up
dev-shell: ## Open a bash shell inside the app container
$(RUN) bash
worker-shell: ## Open a bash shell inside the worker container
$(COMPOSE_DEV) run --rm worker bash
redis-cli: ## Open redis-cli against the dev Redis
$(COMPOSE_DEV) exec redis redis-cli
dev-psql: ## Open psql against the dev Postgres
$(COMPOSE_DEV) exec postgres psql -U struudel -d struudel
db-upgrade: ## Apply all pending migrations
$(RUN) alembic upgrade head
db-downgrade: ## Rollback one migration
$(RUN) alembic downgrade -1
db-migrate: ## Generate migration – MSG="description" required
$(RUN) alembic revision --autogenerate -m "$(MSG)"
db-history: ## Show migration history
$(RUN) alembic history
format: ## Format code with ruff
$(RUN) ruff format .
lint: ## Lint code with ruff
$(RUN) ruff check .
lint-fix: ## Lint and auto-fix with ruff
$(RUN) ruff check --fix .
type-check: ## Type-check with ty
$(RUN) ty check
test: ## Run pytest test-suite
$(RUN) pytest
test-cov: ## Run pytest with coverage report
$(RUN) pytest --cov=struudel --cov-report=term-missing
css-build: ## Build Tailwind + daisyUI CSS (one-shot, minified)
$(RUN) tailwindcss -i /app/css/input.css -o /app/src/struudel/static/css/app.css --minify