-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (45 loc) · 2.08 KB
/
Copy pathMakefile
File metadata and controls
61 lines (45 loc) · 2.08 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
build-ApiFunction:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o bootstrap ./cmd/lambda
build-WorkerFunction:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o worker-bootstrap ./cmd/worker
run:
go run ./cmd/api
test:
gotestsum --format testname ./...
test-verbose:
gotestsum --format standard-verbose ./...
swagger:
swag init -g ./cmd/api/main.go -o ./docs --parseDependency --parseInternal
node ./scripts/build-openapi3.mjs
# ── Atlas migrations ──────────────────────────────────────────────────────────
# Generate a new versioned migration file from the current GORM models.
# Usage: make migrate-diff name=add_foo_column
migrate-diff:
atlas migrate diff --env local $(name)
migrate-diff-prod:
atlas migrate diff --env production $(name)
# Rehash after manually editing migration files.
migrate-hash:
atlas migrate hash --env local
migrate-hash-prod:
atlas migrate hash --env production
# Apply pending migrations — local SQLite dev DB.
migrate-apply:
atlas migrate apply --env local
# Apply pending migrations — production DB (requires DATABASE_URL + DATABASE_DEV_URL).
# Usage: DATABASE_URL=postgres://... DATABASE_DEV_URL=postgres://... make migrate-apply-prod
migrate-apply-prod:
atlas migrate apply --env production
# Show migration status — local dev DB.
migrate-status:
atlas migrate status --env local
# Show migration status — production DB (requires DATABASE_URL).
# Usage: DATABASE_URL=postgres://... make migrate-status-prod
migrate-status-prod:
atlas migrate status --env production
# ── Dev seeds ─────────────────────────────────────────────────────────────────
# Seed inference_logs with 200 synthetic rows spread over 30 days (idempotent).
seed-inference-logs:
sqlite3 hyperstrate-dev.db < internal/db/seeds/inference_logs.sql
seed-agent-sessions:
sqlite3 hyperstrate-dev.db < internal/db/seeds/agent_sessions.sql