-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
33 lines (25 loc) · 845 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
24
25
26
27
28
29
30
31
32
33
PKGS = ./...
TESTFLAGS = -race -vet all -mod readonly
BUILDFLAGS = -v
BENCH = .
BENCHFLAGS = -benchmem -bench=${BENCH}
IMAGE_PREFIX ?= us.gcr.io/kubernetes-dev
GIT_VERSION ?= $(shell git describe --tags --always --dirty)
build:
go build ${BUILDFLAGS} ${PKGS}
test:
go test ${TESTFLAGS} ${PKGS}
benchmark:
go test ${TESTFLAGS} ${BENCHFLAGS} ${PKGS}
checks:
go vet ${PKGS}
go run honnef.co/go/tools/cmd/staticcheck@latest ${PKGS}
make lint
lint:
go run github.com/golangci/golangci-lint/cmd/golangci-lint@latest run -c .golangci.yml
docker:
docker build --build-arg=GIT_VERSION=$(GIT_VERSION) -t $(IMAGE_PREFIX)/unused -f Dockerfile.exporter . --load
docker tag $(IMAGE_PREFIX)/unused $(IMAGE_PREFIX)/unused:$(GIT_VERSION)
push: docker
docker push $(IMAGE_PREFIX)/unused:$(GIT_VERSION)
docker push $(IMAGE_PREFIX)/unused:latest