-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
66 lines (45 loc) · 1.23 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
REGISTRY ?= quay.io/kubevirt
PLUGINS = $(sort \
$(subst /,-,\
$(patsubst cmd/%/,%,\
$(dir \
$(shell find cmd/ -type f -name '*.go')))))
DOCKERFILES = $(sort \
$(subst /,-,\
$(patsubst cmd/%/,%,\
$(dir \
$(shell find cmd/ -type f -name 'Dockerfile')))))
all: build
build: format $(patsubst %, build-%, $(PLUGINS))
build-%:
cd cmd/$(subst -,/,$*) && go fmt && go vet && go install -v
format:
go fmt ./pkg/...
go vet ./pkg/...
test:
go test ./cmd/... ./pkg/...
test-%:
go test ./$(subst -,/,$*)/...
functest:
pytest tests
docker-build: $(patsubst %, docker-build-%, $(DOCKERFILES))
docker-build-%:
@cp ${GOPATH}/bin/${notdir $(subst -,/,$*)} ./cmd/$(subst -,/,$*)
docker build -t ${REGISTRY}/device-plugin-$*:latest ./cmd/$(subst -,/,$*)
docker-push: $(patsubst %, docker-push-%, $(DOCKERFILES))
docker-push-%:
docker push ${REGISTRY}/device-plugin-$*:latest
dep:
dep ensure -v
clean-dep:
rm -f ./Gopkg.lock
rm -rf ./vendor
cluster-up:
./cluster/up.sh
cluster-down:
./cluster/down.sh
cluster-sync: $(patsubst %, cluster-sync-%, $(DOCKERFILES))
cluster-sync-%:
./cluster/build.sh $*
./cluster/sync.sh $*
.PHONY: format build test docker-build docker-push docker-local-push dep clean-dep