-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (28 loc) · 774 Bytes
/
Copy pathMakefile
File metadata and controls
36 lines (28 loc) · 774 Bytes
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
BINARY := serialmonitor
CMD := ./cmd/serialmonitor
IMAGE := dockerhub-username/serialmonitor
TAG := latest
PLATFORMS := linux/amd64,linux/arm64
.PHONY: build run test docker-build docker-push helm-lint
build:
CGO_ENABLED=0 go build -ldflags="-s -w" -o $(BINARY) $(CMD)
run: build
./$(BINARY) --config config.yaml
test:
go test ./...
# Multi-arch image build (requires docker buildx)
docker-build:
docker buildx build \
--platform $(PLATFORMS) \
-t $(IMAGE):$(TAG) \
--push \
.
# Push single-arch local image
docker-push:
docker push $(IMAGE):$(TAG)
helm-lint:
helm lint helm/serialmonitor
helm-install:
helm upgrade --install serialmonitor helm/serialmonitor \
--set image.repository=$(IMAGE) \
--set image.tag=$(TAG)