-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (59 loc) · 2.45 KB
/
Copy pathMakefile
File metadata and controls
76 lines (59 loc) · 2.45 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
.PHONY: build test test-race vet lint fmt integration stress clean \
docker-binaries docker-build docker-up docker-down docker-logs
# cactus requires Go 1.27+ (built-in crypto/mldsa). Until 1.27 ships, the
# default is the gotip 1.27-devel toolchain; override with `make GO=go`
# once a 1.27 release is installed.
GO ?= gotip
BIN_DIR ?= bin
build:
$(GO) build -o $(BIN_DIR)/cactus ./cmd/cactus
$(GO) build -o $(BIN_DIR)/cactus-cli ./cmd/cactus-cli
$(GO) build -o $(BIN_DIR)/cactus-keygen ./cmd/cactus-keygen
$(GO) build -o $(BIN_DIR)/cactus-pollinate ./cmd/cactus-pollinate
test:
$(GO) test ./...
test-race:
$(GO) test -race ./...
vet:
$(GO) vet ./...
# golangci-lint must itself be built with a Go 1.27+ toolchain to
# type-check this module, and its release binaries are built with the
# latest released Go, so install it from source:
# gotip install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.12.2
# The PATH prefix makes golangci-lint's `go` invocations use $(GO)'s
# toolchain.
GOLANGCI_LINT ?= golangci-lint
lint:
PATH="$$($(GO) env GOROOT)/bin:$$PATH" GOTOOLCHAIN=local $(GOLANGCI_LINT) run
fmt:
PATH="$$($(GO) env GOROOT)/bin:$$PATH" GOTOOLCHAIN=local $(GOLANGCI_LINT) fmt
integration:
$(GO) test -race -count=1 -tags=integration ./integration/...
# Bulk issuance stress test. Behind the `stress` build tag so it stays
# out of the normal suite. Defaults to 800 certificates; override with
# CACTUS_STRESS_CERTS / CACTUS_STRESS_CONCURRENCY.
stress:
$(GO) test -race -count=1 -tags=stress -timeout 30m \
-run TestBulkIssuanceStress -v ./integration/...
# --- docker-compose stack (cactus + Sunlight as a tlog-mirror) ---------
#
# The cactus image does not build from source. cactus needs Go 1.27 for
# crypto/mldsa and there is no golang:1.27 image yet, so the binaries are
# cross-built here with gotip and copied into a slim runtime image.
# Sunlight has no such constraint and builds inside its own image.
COMPOSE ?= docker compose -f docker/compose.yaml
docker-binaries:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GO) build -o $(BIN_DIR)/cactus ./cmd/cactus
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GO) build -o $(BIN_DIR)/cactus-cli ./cmd/cactus-cli
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GO) build -o $(BIN_DIR)/cactus-keygen ./cmd/cactus-keygen
docker-build: docker-binaries
$(COMPOSE) build
docker-up: docker-build
$(COMPOSE) up -d
$(COMPOSE) ps
docker-down:
$(COMPOSE) down -v
docker-logs:
$(COMPOSE) logs -f
clean:
rm -rf $(BIN_DIR)