-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (34 loc) · 1.65 KB
/
Copy pathMakefile
File metadata and controls
51 lines (34 loc) · 1.65 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
# Developer entrypoints. `make ci` mirrors the GitHub `ci` workflow, so what
# passes locally passes in CI.
.PHONY: ci build test race e2e e2e-managed fmt fmt-check vet lint cover docker-broker clean appstore-meta appstore-meta-check
ci: fmt-check vet build race e2e ## everything CI runs
build: ## build all binaries
go build ./...
test: ## run unit tests
go test ./...
race: ## run unit tests with the race detector + coverage
go test -race -coverprofile=cover.out -covermode=atomic ./...
e2e: ## real-process broker end-to-end (multi-user, no external services)
./scripts/e2e-broker.sh
e2e-managed: ## full publish→build→register→sign→broker→partner→meter+ratelimit e2e
./scripts/e2e-managed.sh
fmt: ## format the code
gofmt -w cmd internal appstore-meta
fmt-check: ## fail if anything needs formatting
@u="$$(gofmt -l cmd internal appstore-meta)"; if [ -n "$$u" ]; then echo "needs gofmt:"; echo "$$u"; exit 1; fi
vet: ## go vet
go vet ./...
lint: ## staticcheck (same as the CI lint job)
go run honnef.co/go/tools/cmd/staticcheck@latest ./...
cover: race ## show per-package coverage
@go tool cover -func=cover.out | tail -1
docker-broker: ## build the broker image
docker build -f deploy/docker/broker.Dockerfile -t pilot-broker .
appstore-meta: ## run the app-store metadata API against the working data dir
go run ./cmd/appstore-meta-api -data appstore-meta/data
appstore-meta-check: ## validate appstore-meta/data without listening
go run ./cmd/appstore-meta-api -check
clean:
rm -f cover.out
broker-tls: ## (on the VM) nginx + Lets Encrypt HTTPS for the broker
sudo BROKER_HOST=broker.pilotprotocol.network bash deploy/setup-broker-tls.sh