-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
163 lines (106 loc) · 4 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
VERSION = 0.6.0
BUNDLE_IMG = ghcr.io/moonbeam-nyc/snorlax-operator-bundle:${VERSION}
OPERATOR_IMG = ghcr.io/moonbeam-nyc/snorlax-operator:${VERSION}
WAKE_SERVER_IMG = ghcr.io/moonbeam-nyc/snorlax-wake-server:${VERSION}
PROXY_IMG = ghcr.io/moonbeam-nyc/snorlax-proxy:${VERSION}
## Workflows
dev-setup: minikube-delete minikube-start wake-server-install operator-crd-install dummy-install minikube-tunnel
dev-run: operator-run
demo: minikube-reset helm-install-remote dummy-install minikube-tunnel
release: wake-server-release-multiplatform operator-release-multiplatform operator-helmify helm-package
release-images: wake-server-release-multiplatform operator-release-multiplatform
## Local commands
local-proxy-build:
cd proxy && go build -o snorlax-proxy
local-proxy-run: local-proxy-build
cd proxy && ./snorlax-proxy
local-proxy-clean:
cd proxy && rm -f snorlax-proxy
## Helm commands
helm-install-local:
helm install snorlax ./charts/snorlax \
--create-namespace \
--namespace snorlax
helm-install-remote:
helm repo add moonbeam https://moonbeam-nyc.github.io/helm-charts
helm repo update
helm install snorlax moonbeam/snorlax \
--create-namespace \
--namespace snorlax
helm-uninstall:
helm uninstall snorlax --namespace snorlax
helm-package:
cd ./charts/snorlax && helm package .
mv ./charts/snorlax/snorlax-*.tgz .
## Wake server commands
wake-server-build:
cd wake-server && VERSION=$(VERSION) docker compose build snorlax
wake-server-release: wake-server-build
docker push $(WAKE_SERVER_IMG)
wake-server-release-multiplatform:
- docker buildx create --use --name builder
docker buildx use builder
cd wake-server && docker buildx build --platform linux/amd64,linux/arm64 --tag $(WAKE_SERVER_IMG) --push .
wake-server-install: wake-server-build
docker save $(WAKE_SERVER_IMG) | (eval $$(minikube docker-env) && docker load)
wake-server-serve: docker-build
docker run -p 8080:8080 $(WAKE_SERVER_IMG) serve
## Proxy commands
proxy-build:
cd proxy && VERSION=$(VERSION) docker compose build snorlax-proxy
proxy-run:
cd proxy && VERSION=$(VERSION) docker compose up
proxy-release: proxy-build
docker push $(PROXY_IMG)
proxy-release-multiplatform:
- docker buildx create --use --name builder
docker buildx use builder
cd proxy && docker buildx build --platform linux/amd64,linux/arm64 --tag $(PROXY_IMG) --push .
proxy-install: proxy-build
docker save $(PROXY_IMG) | (eval $$(minikube docker-env) && docker load)
## Minikube commands
minikube-reset: minikube-delete minikube-start
minikube-start:
minikube start --addons ingress
kubectl rollout status -n ingress-nginx deployment/ingress-nginx-controller
minikube-delete:
minikube delete
minikube-tunnel:
minikube tunnel
## Dummy app
dummy-install:
kubectl apply -f dummy-app
## Operator CRD
operator-crd-install:
cd operator && make install
operator-crd-uninstall:
cd operator && make uninstall
## Operator
operator-build:
cd operator && make docker-build IMG=$(OPERATOR_IMG)
operator-release: operator-build
cd operator && make docker-push IMG=$(OPERATOR_IMG)
operator-release-multiplatform:
cd operator && make docker-buildx IMG=$(OPERATOR_IMG)
operator-deploy:
cd operator && make deploy IMG=$(OPERATOR_IMG)
operator-helmify:
cd operator && make helmify IMG=$(OPERATOR_IMG)
-rm -rf charts/snorlax
mv operator/snorlax ./charts/snorlax
VERSION=$(VERSION) yq eval ".version = env(VERSION)" -i charts/snorlax/Chart.yaml
VERSION=$(VERSION) yq eval ".appVersion = env(VERSION)" -i charts/snorlax/Chart.yaml
operator-run:
cd operator && make run
## Operator bundle
operator-bundle: operator-bundle-olm-install operator-bundle-init operator-bundle-build operator-bundle-push operator-bundle-deploy
operator-bundle-olm-install:
operator-sdk olm install
operator-bundle-init:
cd operator && make bundle
operator-bundle-build:
cd operator && make bundle-build BUNDLE_IMG=$(BUNDLE_IMG)
operator-bundle-push:
cd operator && make bundle-push BUNDLE_IMG=$(BUNDLE_IMG)
operator-bundle-deploy:
cd operator && operator-sdk run bundle $(BUNDLE_IMG)