forked from tioxy/custom-kube-prometheus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (26 loc) · 726 Bytes
/
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
MAKEFILE := $(lastword $(MAKEFILE_LIST))
GOCMD=go
JSONNETCMD=jsonnet
JSONNETBUNDLERCMD=jb
JSONNET_LIBS=vendor
MANIFESTS_FOLDER=manifests
FILENAME=main.jsonnet
all: clean build
.PHONY: clean
clean:
rm -rf $(MANIFESTS_FOLDER)
mkdir $(MANIFESTS_FOLDER)
.PHONY: build
build:
$(JSONNETCMD) -J $(JSONNET_LIBS) -m $(MANIFESTS_FOLDER) $(FILENAME) \
| xargs -I{} sh -c 'cat {} \
| gojsontoyaml > {}.yaml; rm -f {}' -- {}
.PHONY: update
update:
$(JSONNETBUNDLERCMD) update
install-gojsontoyaml:
$(GOCMD) get -u github.com/brancz/gojsontoyaml
install-jsonnet:
$(GOCMD) get -u github.com/google/go-jsonnet/cmd/jsonnet
install-jsonnetbundler:
$(GOCMD) get -u github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb