-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
97 lines (75 loc) · 3.17 KB
/
Copy pathMakefile
File metadata and controls
97 lines (75 loc) · 3.17 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
.PHONY: build dev test clean frontend backend all security fuzz bench check ci-local ci-dev1 setup-dev1
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
all: build
# Build Vue frontend
frontend:
cd web && npm install && npm run build
# Build Go binary (requires frontend built first)
backend:
go build -ldflags "-X github.com/WithAutonomi/indelible/internal/buildinfo.Version=$(VERSION)" -o bin/indelible ./cmd/indelible
# Build everything
build: frontend backend
@echo "Built bin/indelible $(VERSION)"
# Development: run Go backend with hot reload (requires air)
dev-backend:
air -c .air.toml
# Development: run Vue dev server
dev-frontend:
cd web && npm run dev
# Run both in parallel (requires make -j2)
dev: dev-backend dev-frontend
# Run tests
test:
go test ./...
# Clean build artifacts
clean:
rm -rf bin/ web/dist/ web/node_modules/ smoke/node_modules/ smoke/playwright-report/ smoke/test-results/ e2e/node_modules/ e2e/playwright-report/ e2e/test-results/
# Run database migrations only (useful for dev)
migrate:
go run ./cmd/indelible --migrate-only
# Cross-compile for Linux
build-linux:
cd web && npm install && npm run build
GOOS=linux GOARCH=amd64 go build -ldflags "-X github.com/WithAutonomi/indelible/internal/buildinfo.Version=$(VERSION)" -o bin/indelible-linux-amd64 ./cmd/indelible
# One-shot ops tool: republish DataMaps of pre-existing private uploads. See
# cmd/migrate-publish-datamaps/main.go. Requires antd >= 0.7.0.
migrate-publish-datamaps:
go build -o bin/migrate-publish-datamaps ./cmd/migrate-publish-datamaps
migrate-publish-datamaps-linux:
GOOS=linux GOARCH=amd64 go build -o bin/migrate-publish-datamaps-linux-amd64 ./cmd/migrate-publish-datamaps
# Security scanning (govulncheck + npm audit)
security:
govulncheck ./...
cd web && npm audit --audit-level=high
# Run fuzz tests (30s each)
fuzz:
go test -fuzz=FuzzParseSelector -fuzztime 30s ./internal/services/
go test -fuzz=FuzzValidateToken -fuzztime 30s ./internal/auth/
# Run benchmarks
bench:
go test -bench=. -benchmem -benchtime 3s ./internal/handlers/
# Run all quality checks (lint + test + security)
check: test
golangci-lint run ./...
govulncheck ./...
# Docker build
docker:
docker build -t indelible:$(VERSION) .
# Run the PR-gate CI subset locally (lint, vet, mod verify, swag drift,
# frontend build/test, sqlite Go tests). Mirrors what we still run in CI on
# every PR after the May 2026 trim.
ci-local:
bash scripts/ci-local.sh
# Run the heavyweight CI matrix (race detection, postgres tests, docker
# build/smoke, Playwright E2E) on the dev1 Linux test box via SSH. CI on
# master picks these up post-merge, but use this before pushing if you've
# touched the Dockerfile, dialect-sensitive SQL, or anything race-prone.
# Pass flags with ARGS=... e.g. `make ci-dev1 ARGS="--only e2e"`.
ci-dev1:
bash scripts/ci-dev1.sh $(ARGS)
# One-shot bootstrap for a Linux test box that ci-dev1.sh can target.
# Idempotent — safe to re-run; each phase skips if already in place.
# Use `make setup-dev1 ARGS="--check"` to report state without installing.
# Default targets HOST=prodesk CONTAINER=dev1; override via env or ARGS.
setup-dev1:
bash scripts/setup-dev1.sh $(ARGS)