-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathjustfile
More file actions
60 lines (45 loc) · 1.28 KB
/
justfile
File metadata and controls
60 lines (45 loc) · 1.28 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
set dotenv-load := true
[private]
default:
@just --list
# Export database to backup file
backup:
pg_dump -U postgres -h $PGHOST_PROD -p $PGPORT_PROD -W -f backups/database-{{datetime("%F")}}.bak -F t railway
psql:
psql -U postgres -h $PGHOST_PROD -p $PGPORT_PROD -t railway
# Generate new migrations based on model changes
makemigrations:
uv run manage.py makemigrations
# Apply database migrations
migrate:
uv run manage.py migrate
run-postgres:
docker compose -f docker-compose.dev.yml up -d
# Run server in development mode
run:
uv run manage.py runserver 0.0.0.0:8888
# Run server in production mode
run-prod:
docker/entrypoint.sh
# Seed database with dummy data
seed: migrate
uv run manage.py seed
# Run tests
test *arguments="":
uv run pytest {{arguments}}
# Run behavioral tests
behave arguments="":
uv run manage.py behave {{arguments}}
# Run tests with coverage and generate data file
coverage-run:
uv run coverage run manage.py behave
uv run coverage run -m pytest tests/
uv run coverage combine --quiet
[private]
coverage-html: coverage-run
uv run coverage html
[private]
coverage-open: coverage-html
open htmlcov/index.html
# Run tests, generate coverage HTML report, then open it in the browser
coverage: coverage-open