forked from merbridge/merbridge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
89 lines (69 loc) · 3 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# some makefile commands used by merbridge
load:
[ -f bpf/mb_connect.c ] && make -C bpf load || make -C bpf load-from-obj
attach:
make -C bpf attach
clean:
make -C bpf clean
compile:
make -C bpf compile
generate-compilation-database:
make -f bpf/Makefile generate-compilation-database
lint-c:
clang-format --Werror -n bpf/*.c bpf/headers/*.h
format-c:
find . -regex '.*\.\(c\|h\)' -exec clang-format -style=file -i {} \;
lint-go:
golangci-lint run
format-go:
goimports -w -local github.com/merbridge/merbridge/ .
gofmt -l -d -w .
lint: lint-c lint-go
format: format-c format-go
# update generated yaml for merbridge on linkerd, istio and kuma deploy templates
helm: helm-linkerd helm-istio helm-kuma
# generate merbridge on linkerd deploy templates
helm-linkerd:
helm template --set-string "mode=linkerd" -n "linkerd" merbridge helm > deploy/all-in-one-linkerd.yaml
# generate merbridge on istio deploy templates
helm-istio:
helm template -n "istio-system" merbridge helm > deploy/all-in-one.yaml
# generate merbridge on kuma deploy templates
helm-kuma:
helm template --set-string "mode=kuma" -n "kuma-system" merbridge helm > deploy/all-in-one-kuma.yaml
# generate merbridge on osm deploy templates
helm-osm:
helm template --set-string "mode=osm" --set-string "use-reconnect=true" -n "osm-system" merbridge helm > deploy/all-in-one-osm.yaml
# package helm release
helm-package:
helm package helm
# install helm
helm-install:
which helm || curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
# check helm templates in Github Workflow
# check if the generated yaml has been updated
helm-ci: helm-install
@echo "start to check deploy/all-in-one.yaml"
@helm template -n "istio-system" merbridge helm > deploy/all-in-one-g.yaml
@cmp -s deploy/all-in-one-g.yaml deploy/all-in-one.yaml; \
RETVAL=$$?; \
if [ $$RETVAL -ne 0 ]; then \
echo "deploy/all-in-one.yaml is incorrect, remember to run make make helm-istio to update all-in-one.yaml"; rm -rf deploy/all-in-one-g.yaml; exit 1; \
fi
@rm -rf deploy/all-in-one-g.yaml
@echo "start to check deploy/all-in-one-linkerd.yaml"
@helm template --set-string "mode=linkerd" -n "linkerd" merbridge helm > deploy/all-in-one-linkerd-g.yaml
@cmp -s deploy/all-in-one-linkerd.yaml deploy/all-in-one-linkerd-g.yaml; \
RETVAL=$$?; \
if [ $$RETVAL -ne 0 ]; then \
echo "deploy/all-in-one-linkerd.yaml is incorrect, remember to run make make helm-linkerd to update all-in-one-linkerd.yaml"; rm -rf deploy/all-in-one-linkerd-g.yaml; exit 1; \
fi
@rm -rf deploy/all-in-one-linkerd-g.yaml
@echo "start to check deploy/all-in-one-kuma.yaml"
@helm template --set-string "mode=kuma" -n "kuma-system" merbridge helm > deploy/all-in-one-kuma-g.yaml
@cmp -s deploy/all-in-one-kuma.yaml deploy/all-in-one-kuma-g.yaml; \
RETVAL=$$?; \
if [ $$RETVAL -ne 0 ]; then \
echo "deploy/all-in-one-kuma.yaml is incorrect, remember to run make helm-kuma to update all-in-one-kuma.yaml"; rm -rf deploy/all-in-one-kuma-g.yaml; exit 1; \
fi
@rm -rf deploy/all-in-one-kuma-g.yaml