-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
148 lines (114 loc) · 4.11 KB
/
Copy pathjustfile
File metadata and controls
148 lines (114 loc) · 4.11 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
set dotenv-load
default:
@just --list
install:
corepack enable
pnpm install
# The app, Centrifugo, Postgres, Valkey and MinIO together, since the app needs all five
dev:
#!/usr/bin/env bash
# Centrifugo goes in the background and is taken down on the way out, so a
# stray container cannot outlive the terminal that started it. Postgres,
# Valkey and MinIO are left running: their data is worth keeping between sessions.
set -euo pipefail
mkdir -p data-dev
just services
just realtime --detach
cleanup() {
docker rm --force praetorium-realtime >/dev/null 2>&1 || true
}
trap cleanup EXIT INT TERM
export DATABASE_URL="${DATABASE_URL:-postgres://praetorium:praetorium@127.0.0.1:5432/praetorium}"
export VALKEY_URL="${VALKEY_URL:-redis://127.0.0.1:6379}"
export S3_ENDPOINT="${S3_ENDPOINT:-http://127.0.0.1:9000}"
export S3_BUCKET="${S3_BUCKET:-praetorium}"
export S3_ACCESS_KEY_ID="${S3_ACCESS_KEY_ID:-praetorium}"
export S3_SECRET_ACCESS_KEY="${S3_SECRET_ACCESS_KEY:-praetorium-storage}"
export S3_PUBLIC_BASE_URL="${S3_PUBLIC_BASE_URL:-http://127.0.0.1:9000/praetorium}"
pnpm db:migrate
DATA_DIR=./data-dev CATALOGUE_DIR=./catalogue-data RULES_DIR=./catalogue-data/rules pnpm dev
# The iOS and Android shell against the supported production service
mobile *args:
pnpm mobile -- {{ args }}
mobile-ios:
pnpm mobile:ios
mobile-android:
pnpm mobile:android
# Postgres, Valkey and MinIO alone, for when the dev server is already running
services *args:
sh scripts/devServices.sh {{ args }}
# Take the development Postgres, Valkey and MinIO down
services-down:
sh scripts/devServices.sh down
# Centrifugo alone, for when the dev server is already running
realtime *args:
sh scripts/realtime.sh {{ args }}
format:
pnpm format
lint:
pnpm lint
build:
pnpm build
typecheck:
pnpm typecheck
test *args:
pnpm exec vitest run {{ args }}
# Format, lint, database, catalogue pins, build, typecheck, unit tests
check:
pnpm check
# Fetch the community catalogues (about 130MB, gitignored)
catalogue-sync:
pnpm catalogue:sync
# Verify the pinned revisions without fetching
catalogue-check:
pnpm catalogue:check
# Ratchet description coverage across the fetched rules sources
descriptions:
pnpm catalogue:descriptions
# Price every datasheet against the Munitorum. A ratchet: it may not go down
points:
pnpm catalogue:points
# How much of what the catalogue offers the released 40kdc dataset can also express
parity *args:
pnpm catalogue:parity {{ args }}
# Cross-check 40kdc's generated loadout variants against this app's reading of BSData. Needs KDC_CORE
variants:
pnpm catalogue:variants
# Write everything the app can say about the synced data. Add --compare before.json to list what a snapshot lost
coverage *args:
pnpm catalogue:coverage {{ args }}
db-generate:
pnpm db:generate
db-check:
pnpm db:check
# Bring the schema up to date against DATABASE_URL
db-migrate:
pnpm db:migrate
# A disposable preview world with accounts, armies, battles, and leagues
seed:
#!/usr/bin/env bash
set -euo pipefail
just services
export DATABASE_URL="${DATABASE_URL:-postgres://praetorium:praetorium@127.0.0.1:5432/praetorium}"
pnpm db:migrate
pnpm db:seed
# One-off: move any inline profile picture still in DATABASE_URL into S3_* object storage
profile-images-migrate:
pnpm profile-images:migrate
e2e-install:
pnpm exec playwright install chromium --only-shell
e2e-build:
docker build -t praetorium-e2e .
# Browsers against the container image, which is the topology that ships
e2e *args: e2e-build e2e-down
pnpm exec playwright test {{ args }}
e2e-run *args: e2e-down
pnpm exec playwright test {{ args }}
e2e-native-auth-ios: e2e-build
pnpm test:e2e:native-auth:ios
e2e-trace *args: e2e-build e2e-down
PLAYWRIGHT_TRACE=1 pnpm exec playwright test {{ args }}
# Remove a previous run's containers. Playwright refuses to start if one still
# holds the port, and it probes before it runs anything of ours.
e2e-down:
sh e2e/stack-down.sh ${PLAYWRIGHT_PORT:-4173}