forked from aleofreddi/csi-sanlock-lvm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.mk
31 lines (22 loc) · 919 Bytes
/
common.mk
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
.PHONY: godep
.DEFAULT_GOAL := all
VERSION?=$(shell git describe --tags 2>/dev/null || (printf commit-; git rev-parse --short HEAD))
export VERSION
COMMIT?=$(shell git rev-parse --short HEAD)
export COMMIT
ifeq ($(VERSION), latest)
IMAGE_PULL_POLICY=Always
else
IMAGE_PULL_POLICY=IfNotPresent
endif
export IMAGE_PULL_POLICY
%.pb.go: %.proto
protoc --go_out=plugins=grpc:. --go_opt=paths=source_relative $<
mock/%.mi.go: %.go go.dep
mockgen -package mock -destination $@ -source $<
mock/%.me.go: %.mock go.dep
mockgen -package mock -destination $@ `cat $<`
%.url.yaml: %.url
curl -s -o $@ `cat $< | sed 's/@@EXTERNAL_SNAPSHOTTER_VERSION@@/$(EXTERNAL_SNAPSHOTTER_VERSION)/g;s/@@EXTERNAL_ATTACHER_VERSION@@/$(EXTERNAL_ATTACHER_VERSION)/g;s/@@EXTERNAL_PROVISIONER_VERSION@@/$(EXTERNAL_PROVISIONER_VERSION)/g;s/@@EXTERNAL_RESIZER_VERSION@@/$(EXTERNAL_RESIZER_VERSION)/g;'`
%.var.yaml: %.var
envsubst < $< > $@