-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
89 lines (73 loc) · 3.08 KB
/
Copy pathjustfile
File metadata and controls
89 lines (73 loc) · 3.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
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
# justfile is the primary task runner for m80 (the intentius org uses just).
binary := "m80"
pkg := "./..."
image := "ghcr.io/intentius/m80"
version := `git describe --tags --always --dirty 2>/dev/null || echo dev`
ldflags := "-s -w -X github.com/intentius/m80.Version=" + version
# List available recipes.
default:
@just --list
# Compile all packages (the cmd/m80 binary arrives with the emulator scaffold).
build:
go build -ldflags "{{ldflags}}" {{pkg}}
# Run the test suite.
test:
go test {{pkg}}
# Run the test suite with the race detector.
race:
go test -race {{pkg}}
# Lint with golangci-lint (matches CI once enabled).
lint:
golangci-lint run {{pkg}}
# Check the operation inventory against the upstream service models.
model-watch:
go run ./conformance/cmd/modelwatch
# gofmt check, as CI runs it.
fmt-check:
@out=$(gofmt -l .); if [ -n "$out" ]; then echo "not gofmt-clean:"; echo "$out"; exit 1; fi
# Build the distroless image, stamped with the current version.
image:
docker build --build-arg VERSION={{version}} -t {{image}}:{{version}} -t m80:candidate .
# The release gate, locally: build the image, run the suite against the
# container, tear it down. This is what CI does before it publishes anything.
image-check port="4290": image
#!/usr/bin/env bash
set -euo pipefail
docker rm -f m80-check >/dev/null 2>&1 || true
docker run -d --name m80-check -p {{port}}:4290 m80:candidate -build-delay 300ms >/dev/null
trap 'docker rm -f m80-check >/dev/null 2>&1 || true' EXIT
for _ in $(seq 1 60); do
curl -sf http://localhost:{{port}}/_m80/health >/dev/null && break
sleep 0.5
done
go run ./conformance/cmd/conformance -endpoint http://localhost:{{port}} \
-poll-timeout 20 -vm-endpoint-rewrite http://localhost:{{port}}
# Run the conformance suite against an already-running target.
conformance endpoint="http://localhost:4290":
go run ./conformance/cmd/conformance -endpoint {{endpoint}} -poll-timeout 20 \
-vm-endpoint-rewrite {{endpoint}}
# Cross-compile the release binaries and checksum them.
dist:
#!/usr/bin/env bash
set -euo pipefail
rm -rf dist && mkdir -p dist
for target in linux/amd64 linux/arm64 darwin/amd64 darwin/arm64; do
os="${target%/*}"; arch="${target#*/}"
CGO_ENABLED=0 GOOS="$os" GOARCH="$arch" go build -trimpath \
-ldflags "{{ldflags}}" -o "dist/m80_${os}_${arch}" ./cmd/m80
done
cd dist && shasum -a 256 m80_* > checksums.txt && cat checksums.txt
# Run the floci subset against any endpoint — the CFN-sufficient acceptance
# gate, documented in conformance/SUBSET-FLOCI.md. Exit status is the result.
subset-floci endpoint="http://localhost:4566":
go run ./conformance/cmd/conformance -endpoint {{endpoint}} \
-tags subset:floci -tier load-bearing -poll-timeout 20
# Bring up the k3d + m80 + operator stack for the UAT harness (#18).
uat-up:
./uat/up.sh
# Run KubeMicroVM's UAT suite against it. KUBEMICROVM must point at a checkout.
uat-run:
./uat/run.sh
# Tear the cluster down.
uat-down:
k3d cluster delete m80-uat