-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
70 lines (56 loc) · 1.76 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
COMMONENVVAR=GOOS=linux GOARCH=amd64
BUILDENVVAR=CGO_ENABLED=0
RUNTIME ?= podman
REPOOWNER ?= swsehgal
IMAGENAME ?= resource-topology-exporter
IMAGETAG ?= latest
.PHONY: all
all: build
.PHONY: build
build:
$(COMMONENVVAR) $(BUILDENVVAR) go build -ldflags '-w' -o bin/resource-topology-exporter main.go
.PHONY: gofmt
gofmt:
@echo "Running gofmt"
gofmt -s -w `find . -path ./vendor -prune -o -type f -name '*.go' -print`
.PHONY: govet
govet:
@echo "Running go vet"
go vet
.PHONY: config
config:
@echo "deploying configmap"
kubectl create -f config/examples/sriovdp-configmap.yaml
.PHONY: image
image: build
@echo "building image"
$(RUNTIME) build -f images/Dockerfile -t quay.io/$(REPOOWNER)/$(IMAGENAME):$(IMAGETAG) .
.PHONY: crd
crd:
@echo "deploying crd"
kubectl create -f manifests/crd-apiextension-v1beta1.yaml
.PHONY: push
push: image
@echo "pushing image"
$(RUNTIME) push quay.io/$(REPOOWNER)/$(IMAGENAME):$(IMAGETAG)
.PHONY: deploy
deploy: push
@echo "deploying Resource Topology Exporter"
kubectl create -f manifests/resource-topology-exporter-ds.yaml
.PHONY: deploy-pod
deploy-pod:
@echo "deploying Pods"
kubectl create -f manifests/sample-devices/test-pod-deviceA.yaml
kubectl create -f manifests/sample-devices/test-pod-deviceA-2.yaml
kubectl create -f manifests/sample-devices/test-pod-deviceA-3.yaml
.PHONY: deploy-taerror
deploy-taerror:
@echo "deploying Pod"
kubectl create -f manifests/test-deployment-taerror.yaml
clean-binaries:
rm -f bin/resource-topology-exporter
clean: clean-binaries
kubectl delete -f manifests/resource-topology-exporter-ds.yaml
kubectl delete -f manifests/sample-devices/test-pod-deviceA.yaml
kubectl delete -f manifests/sample-devices/test-pod-deviceA-2.yaml
kubectl delete -f manifests/sample-devices/test-pod-deviceA-3.yaml