forked from k8snetworkplumbingwg/kubemacpool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
80 lines (56 loc) · 1.84 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Image URL to use all building/pushing image targets
REGISTRY ?= quay.io
IMAGE_TAG ?= latest
IMG ?= kubevirt/kubemacpool
all: generate generate-deploy generate-test
# Run tests
test:
go test ./pkg/... ./cmd/... -coverprofile cover.out
functest:
./hack/functest.sh
# Deploy controller in the configured Kubernetes cluster in ~/.kube/config
deploy: generate-deploy
kubectl apply -f config/test/kubemacpool.yaml
deploy-test: generate-test
kubectl apply -f config/test/kubemacpool.yaml
generate-deploy: manifests
kustomize build config/release > config/release/kubemacpool.yaml
generate-test: manifests
kustomize build config/test > config/test/kubemacpool.yaml
# Generate manifests e.g. CRD, RBAC etc.
manifests:
go run vendor/sigs.k8s.io/controller-tools/cmd/controller-gen/main.go crd --output-dir config/default/crd
go run vendor/sigs.k8s.io/controller-tools/cmd/controller-gen/main.go rbac --output-dir config/default/rbac
# Run go fmt against code
fmt:
go fmt ./pkg/... ./cmd/... ./tests/...
# Run go vet against code
vet:
go vet ./pkg/... ./cmd/... ./tests/...
# Generate code
generate: fmt vet manifests
go generate ./pkg/... ./cmd/...
goveralls:
./hack/goveralls.sh
docker-goveralls: docker-test
./hack/run.sh goveralls
docker-generate:
./hack/run.sh
# Test Inside a docker
docker-test:
./hack/run.sh test
# Build the docker image
docker-build:
docker build . -t ${REGISTRY}/${IMG}:${IMAGE_TAG}
# Push the docker image
docker-push:
docker push ${REGISTRY}/${IMG}:${IMAGE_TAG}
cluster-up:
./cluster/up.sh
cluster-down:
./cluster/down.sh
cluster-sync:
./cluster/sync.sh
deploy-test-cluster:
./hack/deploy-test-cluster.sh
.PHONY: test deploy deploy-test generate-deploy generate-test manifests fmt vet generate goveralls docker-goveralls docker-test docker-build docker-push cluster-up cluster-down cluster-sync deploy-test-cluster