-
Notifications
You must be signed in to change notification settings - Fork 278
/
Makefile
44 lines (30 loc) · 1.18 KB
/
Makefile
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
all: build
PREFIX?=registry.aliyuncs.com/acs
FLAGS=
ARCH?=amd64
ALL_ARCHITECTURES=amd64 arm arm64 ppc64le s390x
ML_PLATFORMS=linux/amd64,linux/arm,linux/arm64,linux/ppc64le,linux/s390x
VERSION?=v1.2.0
GIT_COMMIT:=$(shell git rev-parse --short HEAD)
KUBE_EVENTER_LDFLAGS=-w -X github.com/AliyunContainerService/kube-eventer/version.Version=$(VERSION) -X github.com/AliyunContainerService/kube-eventer/version.GitCommit=$(GIT_COMMIT)
fmt:
find . -type f -name "*.go" | grep -v "./vendor*" | xargs gofmt -s -w
build: clean
go mod tidy & go mod vendor
GOARCH=$(ARCH) CGO_ENABLED=0 go build -ldflags "$(KUBE_EVENTER_LDFLAGS)" -o kube-eventer github.com/AliyunContainerService/kube-eventer
sanitize:
hack/check_gofmt.sh
hack/run_vet.sh
test-unit: clean sanitize build
ifeq ($(ARCH),amd64)
GOARCH=$(ARCH) go test --test.short -race ./... $(FLAGS)
else
GOARCH=$(ARCH) go test --test.short ./... $(FLAGS)
endif
test-unit-cov: clean sanitize build
hack/coverage.sh
docker-container:
docker build --pull -t $(PREFIX)/kube-eventer-$(ARCH):$(VERSION)-$(GIT_COMMIT)-aliyun -f deploy/Dockerfile .
clean:
rm -f kube-eventer
.PHONY: all build sanitize test-unit test-unit-cov docker-container clean fmt