forked from wonderflow/kube-webhook-certgen
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (27 loc) · 702 Bytes
/
Makefile
File metadata and controls
38 lines (27 loc) · 702 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
# Repo info
GIT_COMMIT ?= git-$(shell git rev-parse --short HEAD)
# Image URL to use all building/pushing image targets
CERT_GEN_IMAGE ?= oamdev/kube-webhook-certgen:v2.2
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
GOBIN=$(shell go env GOPATH)/bin
else
GOBIN=$(shell go env GOBIN)
endif
build: reviewable
go build -o main ./main.go
# Run go fmt against code
fmt:
go fmt ./pkg/... ./cmd/...
# Run go vet against code
vet:
go vet ./pkg/... ./cmd/...
reviewable: fmt vet
go mod tidy
# Run tests
test: vet
go test ./pkg/...
docker-build:
docker build -t $(CERT_GEN_IMAGE) .
docker-push:
docker push $(CERT_GEN_IMAGE)