forked from aylei/kubectl-debug
-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathMakefile
23 lines (16 loc) · 750 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
.PHONY: build kubectl-debug-binary debug-agent-binary debug-agent-docker-image check
LDFLAGS = $(shell ./version.sh)
GOENV := GO15VENDOREXPERIMENT="1" GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64
GO := $(GOENV) go
default: build
build: kubectl-debug-binary debug-agent-docker-image
kubectl-debug-binary:
GO111MODULE=on CGO_ENABLED=0 go build -ldflags '$(LDFLAGS)' -o kubectl-debug cmd/kubectl-debug/main.go
debug-agent-docker-image: debug-agent-binary
docker build . -t jamesgrantmediakind/debug-agent:latest
debug-agent-binary:
$(GO) build -ldflags '$(LDFLAGS)' -o debug-agent cmd/debug-agent/main.go
check:
find . -iname '*.go' -type f | grep -v /vendor/ | xargs gofmt -l
GO111MODULE=on go test -v -race ./...
$(GO) vet ./...