Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
320 lines (280 loc) · 17.8 KB
/
Copy pathMakefile
File metadata and controls
320 lines (280 loc) · 17.8 KB
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
ROOT := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
REGISTRY ?= quay.io/masales
PLATFORMS := linux/amd64,linux/arm64
ENV ?= crc
ifeq ($(ENV),crc)
NAMESPACE ?= swim-demo
else
NAMESPACE ?= swim-example-apps
endif
CHART_DASHBOARD := $(ROOT)dnotam-operations-dashboard/deploy/helm/dnotam-dashboard
CHART_PUBLISHER := $(ROOT)dnotam-event-publisher/deploy/helm/dnotam-event-publisher
CHART_MANAGER := $(ROOT)ed254-arrival-flow-manager/deploy/helm/ed254-arrival-flow-manager
CHART_AMAN := $(ROOT)ed254-aman-client/deploy/helm/ed254-aman-client
.PHONY: help sync pull \
dnotam-dashboard-jvm dnotam-dashboard-backend-jvm dnotam-dashboard-frontend-jvm \
dnotam-publisher-jvm dnotam-publisher-backend-jvm dnotam-publisher-frontend-jvm \
ed254-manager-jvm ed254-manager-backend-jvm ed254-manager-frontend-jvm \
ed254-aman-jvm ed254-aman-backend-jvm ed254-aman-frontend-jvm \
deploy-dnotam-dashboard deploy-dnotam-publisher deploy-ed254-manager deploy-ed254-aman \
cleanup-dnotam-dashboard cleanup-dnotam-publisher cleanup-ed254-manager cleanup-ed254-aman \
deploy-all cleanup-all \
status
.DEFAULT_GOAL := help
help:
@echo "Container Images (multi-arch: linux/amd64 + linux/arm64)"
@echo ""
@echo " Image strategy: one repo per app, tags 'backend' and 'frontend'"
@echo ""
@echo " Full app (backend + frontend):"
@echo " dnotam-dashboard-jvm DNOTAM Operations Dashboard"
@echo " dnotam-publisher-jvm DNOTAM Event Publisher"
@echo " ed254-manager-jvm ED-254 Arrival Flow Manager"
@echo " ed254-aman-jvm ED-254 Collaborative AMAN Client"
@echo ""
@echo " Individual components:"
@echo " dnotam-dashboard-backend-jvm / dnotam-dashboard-frontend-jvm"
@echo " dnotam-publisher-backend-jvm / dnotam-publisher-frontend-jvm"
@echo " ed254-manager-backend-jvm / ed254-manager-frontend-jvm"
@echo " ed254-aman-backend-jvm / ed254-aman-frontend-jvm"
@echo ""
@echo "Deploy to OpenShift (helm upgrade --install, ENV=$(ENV), namespace=$(NAMESPACE))"
@echo ""
@echo " deploy-dnotam-dashboard DNOTAM Operations Dashboard"
@echo " deploy-dnotam-publisher DNOTAM Event Publisher"
@echo " deploy-ed254-manager ED-254 Arrival Flow Manager"
@echo " deploy-ed254-aman ED-254 Collaborative AMAN Client"
@echo " deploy-all All example apps"
@echo ""
@echo "Cleanup (helm uninstall + PVCs)"
@echo ""
@echo " cleanup-dnotam-dashboard DNOTAM Operations Dashboard"
@echo " cleanup-dnotam-publisher DNOTAM Event Publisher"
@echo " cleanup-ed254-manager ED-254 Arrival Flow Manager"
@echo " cleanup-ed254-aman ED-254 Collaborative AMAN Client"
@echo " cleanup-all All example apps"
@echo ""
@echo "Other:"
@echo " status Show pods and routes"
@echo ""
@echo "Override: REGISTRY=quay.io/masales ENV=crc NAMESPACE=swim-demo"
# =============================================================================
# Container Images — JVM multi-arch
# =============================================================================
sync: pull
pull:
@git pull --ff-only
# -----------------------------------------------------------------------------
# DNOTAM Operations Dashboard
# Image: $(REGISTRY)/example-apps-dnotam-dashboard:{backend,frontend}
# -----------------------------------------------------------------------------
dnotam-dashboard-backend-jvm:
@echo "[1/3] Building multi-arch backend image ($(PLATFORMS))..."
@podman rmi $(REGISTRY)/example-apps-dnotam-dashboard:backend >/dev/null 2>&1 || true
@podman manifest rm $(REGISTRY)/example-apps-dnotam-dashboard:backend >/dev/null 2>&1 || true
podman manifest create $(REGISTRY)/example-apps-dnotam-dashboard:backend
cd $(ROOT)dnotam-operations-dashboard/backend && podman build --no-cache --platform $(PLATFORMS) \
-f Containerfile --manifest $(REGISTRY)/example-apps-dnotam-dashboard:backend .
@echo "[2/3] Pushing multi-arch manifest..."
podman manifest push --all $(REGISTRY)/example-apps-dnotam-dashboard:backend docker://$(REGISTRY)/example-apps-dnotam-dashboard:backend
@echo ""
@echo "Pushed: $(REGISTRY)/example-apps-dnotam-dashboard:backend (JVM multi-arch)"
dnotam-dashboard-frontend-jvm:
@echo "[1/3] Building multi-arch frontend image ($(PLATFORMS))..."
@podman rmi $(REGISTRY)/example-apps-dnotam-dashboard:frontend >/dev/null 2>&1 || true
@podman manifest rm $(REGISTRY)/example-apps-dnotam-dashboard:frontend >/dev/null 2>&1 || true
podman manifest create $(REGISTRY)/example-apps-dnotam-dashboard:frontend
cd $(ROOT)dnotam-operations-dashboard/frontend && podman build --no-cache --platform $(PLATFORMS) \
-f Containerfile --manifest $(REGISTRY)/example-apps-dnotam-dashboard:frontend .
@echo "[2/3] Pushing multi-arch manifest..."
podman manifest push --all $(REGISTRY)/example-apps-dnotam-dashboard:frontend docker://$(REGISTRY)/example-apps-dnotam-dashboard:frontend
@echo ""
@echo "Pushed: $(REGISTRY)/example-apps-dnotam-dashboard:frontend (multi-arch)"
dnotam-dashboard-jvm: dnotam-dashboard-backend-jvm dnotam-dashboard-frontend-jvm
# -----------------------------------------------------------------------------
# DNOTAM Event Publisher
# Image: $(REGISTRY)/example-apps-dnotam-publisher:{backend,frontend}
# -----------------------------------------------------------------------------
dnotam-publisher-backend-jvm:
@echo "[1/3] Building multi-arch backend image ($(PLATFORMS))..."
@podman rmi $(REGISTRY)/example-apps-dnotam-publisher:backend >/dev/null 2>&1 || true
@podman manifest rm $(REGISTRY)/example-apps-dnotam-publisher:backend >/dev/null 2>&1 || true
podman manifest create $(REGISTRY)/example-apps-dnotam-publisher:backend
cd $(ROOT)dnotam-event-publisher/backend && podman build --no-cache --platform $(PLATFORMS) \
-f Containerfile --manifest $(REGISTRY)/example-apps-dnotam-publisher:backend .
@echo "[2/3] Pushing multi-arch manifest..."
podman manifest push --all $(REGISTRY)/example-apps-dnotam-publisher:backend docker://$(REGISTRY)/example-apps-dnotam-publisher:backend
@echo ""
@echo "Pushed: $(REGISTRY)/example-apps-dnotam-publisher:backend (JVM multi-arch)"
dnotam-publisher-frontend-jvm:
@echo "[1/3] Building multi-arch frontend image ($(PLATFORMS))..."
@podman rmi $(REGISTRY)/example-apps-dnotam-publisher:frontend >/dev/null 2>&1 || true
@podman manifest rm $(REGISTRY)/example-apps-dnotam-publisher:frontend >/dev/null 2>&1 || true
podman manifest create $(REGISTRY)/example-apps-dnotam-publisher:frontend
cd $(ROOT)dnotam-event-publisher/frontend && podman build --no-cache --platform $(PLATFORMS) \
-f Containerfile --manifest $(REGISTRY)/example-apps-dnotam-publisher:frontend .
@echo "[2/3] Pushing multi-arch manifest..."
podman manifest push --all $(REGISTRY)/example-apps-dnotam-publisher:frontend docker://$(REGISTRY)/example-apps-dnotam-publisher:frontend
@echo ""
@echo "Pushed: $(REGISTRY)/example-apps-dnotam-publisher:frontend (multi-arch)"
dnotam-publisher-jvm: dnotam-publisher-backend-jvm dnotam-publisher-frontend-jvm
# -----------------------------------------------------------------------------
# ED-254 Arrival Flow Manager
# Image: $(REGISTRY)/example-apps-ed254-manager:{backend,frontend}
# -----------------------------------------------------------------------------
ed254-manager-backend-jvm:
@echo "[1/3] Building multi-arch backend image ($(PLATFORMS))..."
@podman rmi $(REGISTRY)/example-apps-ed254-manager:backend >/dev/null 2>&1 || true
@podman manifest rm $(REGISTRY)/example-apps-ed254-manager:backend >/dev/null 2>&1 || true
podman manifest create $(REGISTRY)/example-apps-ed254-manager:backend
cd $(ROOT)ed254-arrival-flow-manager/backend && podman build --no-cache --platform $(PLATFORMS) \
-f Containerfile --manifest $(REGISTRY)/example-apps-ed254-manager:backend .
@echo "[2/3] Pushing multi-arch manifest..."
podman manifest push --all $(REGISTRY)/example-apps-ed254-manager:backend docker://$(REGISTRY)/example-apps-ed254-manager:backend
@echo ""
@echo "Pushed: $(REGISTRY)/example-apps-ed254-manager:backend (JVM multi-arch)"
ed254-manager-frontend-jvm:
@echo "[1/3] Building multi-arch frontend image ($(PLATFORMS))..."
@podman rmi $(REGISTRY)/example-apps-ed254-manager:frontend >/dev/null 2>&1 || true
@podman manifest rm $(REGISTRY)/example-apps-ed254-manager:frontend >/dev/null 2>&1 || true
podman manifest create $(REGISTRY)/example-apps-ed254-manager:frontend
cd $(ROOT)ed254-arrival-flow-manager/frontend && podman build --no-cache --platform $(PLATFORMS) \
-f Containerfile --manifest $(REGISTRY)/example-apps-ed254-manager:frontend .
@echo "[2/3] Pushing multi-arch manifest..."
podman manifest push --all $(REGISTRY)/example-apps-ed254-manager:frontend docker://$(REGISTRY)/example-apps-ed254-manager:frontend
@echo ""
@echo "Pushed: $(REGISTRY)/example-apps-ed254-manager:frontend (multi-arch)"
ed254-manager-jvm: ed254-manager-backend-jvm ed254-manager-frontend-jvm
# -----------------------------------------------------------------------------
# ED-254 Collaborative AMAN Client
# Image: $(REGISTRY)/example-apps-ed254-aman:{backend,frontend}
# -----------------------------------------------------------------------------
ed254-aman-backend-jvm:
@echo "[1/3] Building multi-arch backend image ($(PLATFORMS))..."
@podman rmi $(REGISTRY)/example-apps-ed254-aman:backend >/dev/null 2>&1 || true
@podman manifest rm $(REGISTRY)/example-apps-ed254-aman:backend >/dev/null 2>&1 || true
podman manifest create $(REGISTRY)/example-apps-ed254-aman:backend
cd $(ROOT)ed254-aman-client/backend && podman build --no-cache --platform $(PLATFORMS) \
-f Containerfile --manifest $(REGISTRY)/example-apps-ed254-aman:backend .
@echo "[2/3] Pushing multi-arch manifest..."
podman manifest push --all $(REGISTRY)/example-apps-ed254-aman:backend docker://$(REGISTRY)/example-apps-ed254-aman:backend
@echo ""
@echo "Pushed: $(REGISTRY)/example-apps-ed254-aman:backend (JVM multi-arch)"
ed254-aman-frontend-jvm:
@echo "[1/3] Building multi-arch frontend image ($(PLATFORMS))..."
@podman rmi $(REGISTRY)/example-apps-ed254-aman:frontend >/dev/null 2>&1 || true
@podman manifest rm $(REGISTRY)/example-apps-ed254-aman:frontend >/dev/null 2>&1 || true
podman manifest create $(REGISTRY)/example-apps-ed254-aman:frontend
cd $(ROOT)ed254-aman-client/frontend && podman build --no-cache --platform $(PLATFORMS) \
-f Containerfile --manifest $(REGISTRY)/example-apps-ed254-aman:frontend .
@echo "[2/3] Pushing multi-arch manifest..."
podman manifest push --all $(REGISTRY)/example-apps-ed254-aman:frontend docker://$(REGISTRY)/example-apps-ed254-aman:frontend
@echo ""
@echo "Pushed: $(REGISTRY)/example-apps-ed254-aman:frontend (multi-arch)"
ed254-aman-jvm: ed254-aman-backend-jvm ed254-aman-frontend-jvm
# =============================================================================
# Deploy — helm upgrade --install
# =============================================================================
deploy-dnotam-dashboard:
@echo ""
@echo "═══════════════════════════════════════════════════"
@echo " DNOTAM Operations Dashboard — Deploy (ENV=$(ENV))"
@echo "═══════════════════════════════════════════════════"
helm upgrade --install dnotam-dashboard $(CHART_DASHBOARD) \
--namespace $(NAMESPACE) --create-namespace \
-f $(CHART_DASHBOARD)/values-$(ENV).yaml \
--wait --timeout 5m
-oc rollout restart deployment/dnotam-dashboard-backend -n $(NAMESPACE)
-oc rollout restart deployment/dnotam-dashboard-frontend -n $(NAMESPACE)
deploy-dnotam-publisher:
@echo ""
@echo "═══════════════════════════════════════════════════"
@echo " DNOTAM Event Publisher — Deploy (ENV=$(ENV))"
@echo "═══════════════════════════════════════════════════"
helm upgrade --install dnotam-event-publisher $(CHART_PUBLISHER) \
--namespace $(NAMESPACE) --create-namespace \
-f $(CHART_PUBLISHER)/values-$(ENV).yaml \
--wait --timeout 5m
-oc rollout restart deployment/dnotam-event-publisher-backend -n $(NAMESPACE)
-oc rollout restart deployment/dnotam-event-publisher-frontend -n $(NAMESPACE)
deploy-ed254-manager:
@echo ""
@echo "═══════════════════════════════════════════════════"
@echo " ED-254 Arrival Flow Manager — Deploy (ENV=$(ENV))"
@echo "═══════════════════════════════════════════════════"
helm upgrade --install ed254-arrival-flow-manager $(CHART_MANAGER) \
--namespace $(NAMESPACE) --create-namespace \
-f $(CHART_MANAGER)/values-$(ENV).yaml \
--wait --timeout 5m
-oc rollout restart deployment/ed254-arrival-flow-manager-backend -n $(NAMESPACE)
-oc rollout restart deployment/ed254-arrival-flow-manager-frontend -n $(NAMESPACE)
deploy-ed254-aman:
@echo ""
@echo "═══════════════════════════════════════════════════"
@echo " ED-254 Collaborative AMAN Client — Deploy (ENV=$(ENV))"
@echo "═══════════════════════════════════════════════════"
helm upgrade --install ed254-aman-client $(CHART_AMAN) \
--namespace $(NAMESPACE) --create-namespace \
-f $(CHART_AMAN)/values-$(ENV).yaml \
--wait --timeout 5m
-oc rollout restart deployment/ed254-aman-client-backend -n $(NAMESPACE)
-oc rollout restart deployment/ed254-aman-client-frontend -n $(NAMESPACE)
deploy-all: deploy-dnotam-dashboard deploy-dnotam-publisher deploy-ed254-manager deploy-ed254-aman
# =============================================================================
# Cleanup — helm uninstall + PVCs
# =============================================================================
cleanup-dnotam-dashboard:
@echo ""
@echo "═══════════════════════════════════════════════════"
@echo " DNOTAM Operations Dashboard — Cleanup"
@echo "═══════════════════════════════════════════════════"
-helm uninstall dnotam-dashboard --namespace $(NAMESPACE)
-oc delete pvc -l app.kubernetes.io/instance=dnotam-dashboard -n $(NAMESPACE)
-oc delete configmap -l app.kubernetes.io/instance=dnotam-dashboard -n $(NAMESPACE)
-oc delete secret -l app.kubernetes.io/instance=dnotam-dashboard -n $(NAMESPACE)
@echo "Cleanup complete."
cleanup-dnotam-publisher:
@echo ""
@echo "═══════════════════════════════════════════════════"
@echo " DNOTAM Event Publisher — Cleanup"
@echo "═══════════════════════════════════════════════════"
-helm uninstall dnotam-event-publisher --namespace $(NAMESPACE)
-oc delete configmap -l app.kubernetes.io/instance=dnotam-event-publisher -n $(NAMESPACE)
-oc delete secret -l app.kubernetes.io/instance=dnotam-event-publisher -n $(NAMESPACE)
@echo "Cleanup complete."
cleanup-ed254-manager:
@echo ""
@echo "═══════════════════════════════════════════════════"
@echo " ED-254 Arrival Flow Manager — Cleanup"
@echo "═══════════════════════════════════════════════════"
-helm uninstall ed254-arrival-flow-manager --namespace $(NAMESPACE)
-oc delete configmap -l app.kubernetes.io/instance=ed254-arrival-flow-manager -n $(NAMESPACE)
-oc delete secret -l app.kubernetes.io/instance=ed254-arrival-flow-manager -n $(NAMESPACE)
@echo "Cleanup complete."
cleanup-ed254-aman:
@echo ""
@echo "═══════════════════════════════════════════════════"
@echo " ED-254 Collaborative AMAN Client — Cleanup"
@echo "═══════════════════════════════════════════════════"
-helm uninstall ed254-aman-client --namespace $(NAMESPACE)
-oc delete configmap -l app.kubernetes.io/instance=ed254-aman-client -n $(NAMESPACE)
-oc delete secret -l app.kubernetes.io/instance=ed254-aman-client -n $(NAMESPACE)
@echo "Cleanup complete."
cleanup-all: cleanup-dnotam-dashboard cleanup-dnotam-publisher cleanup-ed254-manager cleanup-ed254-aman
# =============================================================================
# Status
# =============================================================================
status:
@echo ""
@echo "═══════════════════════════════════════════════════"
@echo " Example Apps — Status ($(NAMESPACE))"
@echo "═══════════════════════════════════════════════════"
@echo ""
@echo "Helm Releases:"
@helm list -n $(NAMESPACE) 2>/dev/null || echo " (none or not logged in)"
@echo ""
@echo "Pods:"
@oc get pods -n $(NAMESPACE) 2>/dev/null || echo " (not logged in)"
@echo ""
@echo "Routes:"
@oc get route -n $(NAMESPACE) 2>/dev/null || echo " (not logged in)"