forked from kubevirt/cloud-provider-kubevirt
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
53 lines (42 loc) · 1.08 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
VERSION ?= v0.1.0
REGISTRY ?= kubevirt
CLUSTER_NAME ?= kubevirt
KUBECONFIG := dev/kubeconfig
CLOUD_CONFIG := dev/cloud-config
CERT_DIR := dev/
.PHONY: all
all: clean test build
.PHONY: start
start:
go run ./cmd/kubevirt-cloud-controller-manager \
--kubeconfig=$(KUBECONFIG) \
--cloud-provider=kubevirt \
--use-service-account-credentials \
--cloud-config=$(CLOUD_CONFIG) \
--cluster-name=$(CLUSTER_NAME) \
--cert-dir=$(CERT_DIR) \
--v=2
.PHONY: clean
clean:
if [ -d bin ]; then rm -r bin; fi
go clean -modcache -i -x ./...
.PHONY:deps-update
deps-update:
go mod tidy
bin:
mkdir bin
.PHONY: test
test:
go test ./pkg/...
.PHONY: build
build: bin
CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o bin/kubevirt-cloud-controller-manager ./cmd/kubevirt-cloud-controller-manager
.PHONY:image
image: build
docker build -t $(REGISTRY)/kubevirt-cloud-controller-manager:$(VERSION) -f build/images/kubevirt-cloud-controller-manager/Dockerfile .
.PHONY: push
push:
docker push $(REGISTRY)/kubevirt-cloud-controller-manager:$(VERSION)
.PHONY: generate
generate:
go generate ./pkg/...