-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (43 loc) · 1.31 KB
/
Copy pathMakefile
File metadata and controls
58 lines (43 loc) · 1.31 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
.PHONY: up down build logs test test-backend test-frontend test-e2e migrate migration init shell-backend shell-db
# First-time setup: build, start, init migrations, apply
init:
docker compose up -d --build
docker compose exec backend flask --app app db init
docker compose exec backend flask --app app db migrate -m "initial schema"
docker compose exec backend flask --app app db upgrade
up:
docker compose up -d
down:
docker compose down
build:
docker compose build
logs:
docker compose logs -f
# Run database migrations inside the backend container
migrate:
docker compose exec backend flask --app app db upgrade
# Create a new migration
migration:
docker compose exec backend flask --app app db migrate -m "$(MSG)"
# Backend unit tests (runs locally against test DB)
test-backend:
cd backend && python3 -m pytest --tb=short -q
# Frontend unit tests
test-frontend:
cd frontend && npm run test
build-frontend:
cd frontend && npm run build
# Frontend coverage
test-frontend-coverage:
cd frontend && npm run test:coverage
# E2E tests (requires running stack)
test-e2e:
cd frontend && npm run test:e2e
# Run all tests
test: test-backend test-frontend
# Shell into backend container
shell-backend:
docker compose exec backend bash
# Shell into postgres
shell-db:
docker compose exec db psql -U pingouin pingouin