forked from CloudNativeSDWAN/cnwan-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (35 loc) · 970 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
34
35
36
37
38
39
40
41
42
43
44
# Image URL to use all building/pushing image targets
IMG ?= {CONTAINER_IMAGE}
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=true"
ifeq ($(IMG),{CONTAINER_IMAGE})
TAG := $(shell ./scripts/get-latest.sh)
IMG := cnwan/cnwan-operator:${TAG}
endif
# 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
# Run tests
test: fmt vet
go test ./pkg/... ./internal/... -coverprofile cover.out
# Build manager binary
manager: fmt vet
go build -o bin/manager 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 ./...
# Build the docker image
docker-build: test
docker build . -t ${IMG}
# Push the docker image
docker-push:
docker push ${IMG}