-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
55 lines (40 loc) · 1.09 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
45
46
47
48
49
50
51
52
53
54
55
VERSION ?= 0.1.0
# Image URL to use all building/pushing image targets
IMG ?= coveros/genoa-webhook:${VERSION}
# 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
all: build-binary
# Run tests
test: fmt vet
go test -v ./... -coverprofile cover.out
# Build webhook binary
build-binary: fmt vet
go build -o bin/genoa-webhook main.go
# Run against the configured Kubernetes cluster in ~/.kube/config
run: fmt vet
go run ./main.go
# Run go fmt against code
fmt:
go fmt ./...
# Run go vet against code
vet:
go vet ./...
mody-tidy:
go mod tidy
# Build the docker image
docker-build:
docker build . -t ${IMG}
# Push the docker image
docker-push:
docker push ${IMG}
local-build: mody-tidy vet fmt docker-build
build: local-build docker-push
deploy-chart:
kubectl create ns genoa || true
helm upgrade genoa-webhook charts/genoa-webhook --install --namespace=genoa --set deployments.image.tag=${VERSION}
uninstall-chart:
helm uninstall -n genoa genoa-webhook || true