-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (32 loc) · 1.02 KB
/
Makefile
File metadata and controls
42 lines (32 loc) · 1.02 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
.PHONY: build build-static clean test docker docker-local docker-push
BINARY_NAME=ripple
IMAGE_NAME?=ripple
REGISTRY?=
TAG?=latest
# Standard build
build:
go build -o $(BINARY_NAME) .
# Static build for Kubernetes (no external dependencies)
build-static:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o $(BINARY_NAME) .
# Build for ARM64 (e.g., AWS Graviton)
build-static-arm64:
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o $(BINARY_NAME)-arm64 .
clean:
rm -f $(BINARY_NAME) $(BINARY_NAME)-arm64
test:
go test -v ./...
# Docker builds using buildx bake
# Build multi-platform image (amd64 + arm64)
docker:
docker buildx bake --file docker-bake.hcl \
--set "*.tags=$(IMAGE_NAME):$(TAG)" \
ripple
# Build and load locally (single platform)
docker-local:
docker buildx bake --file docker-bake.hcl --load local
# Build and push to registry (multi-platform)
docker-push:
docker buildx bake --file docker-bake.hcl --push \
--set "*.tags=$(REGISTRY)/$(IMAGE_NAME):$(TAG)" \
ripple