-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
61 lines (48 loc) · 1.52 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
BIN_DIR?=$(shell pwd)/tmp/bin
JB_BIN=$(BIN_DIR)/jb
GOJSONTOYAML_BIN=$(BIN_DIR)/gojsontoyaml
JSONNET_BIN=$(BIN_DIR)/jsonnet
JSONNETFMT_BIN=$(BIN_DIR)/jsonnetfmt
TOOLING=$(JSONNETFMT_BIN) $(JSONNET_BIN) $(GOJSONTOYAML_BIN) $(JB_BIN)
JSONNET_FMT := $(JSONNETFMT_BIN) -n 2 --max-blank-lines 2 --string-style s --comment-style s
all: fmt lint generate
.PHONY: clean
clean:
# Delete files marked in .gitignore
git clean -Xfd .
.PHONY: generate
generate: $(JSONNET_BIN)
./hack/generate.sh
.PHONY: fmt
fmt: $(JSONNETFMT_BIN)
find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | \
xargs -n 1 -- $(JSONNET_FMT) -i
.PHONY: lint
lint: $(JSONNETFMT_BIN)
find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | \
while read f; do \
$(JSONNET_FMT) "$$f" | diff -u "$$f" -; \
done
.PHONY: promtool-lint
promtool-lint:
promtool check rules monitoring-satellite/manifests/ci_prometheus_rules.yaml
$(BIN_DIR):
mkdir -p $(BIN_DIR)
$(TOOLING): $(BIN_DIR)
@echo Installing tools from tools.go
@cd hack && cat tools.go | grep _ | awk -F'"' '{print $$2}' | xargs -tI % go build -modfile=go.mod -o $(BIN_DIR) %
.PHONY: update
update: $(JB_BIN)
$(JB_BIN) update
.PHONY: deploy-satellite
deploy-satellite: generate
./hack/prepare-kind.sh
./hack/deploy-crds.sh
@cd installer && $(MAKE) apply-satellite
.PHONY: deploy-central
deploy-central: generate
./hack/prepare-kind.sh
./hack/deploy-central.sh
.PHONY: test-e2e
test-e2e:
@cd tests/e2e && go test -timeout 55m -v . -count=1