-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (49 loc) · 1.6 KB
/
Makefile
File metadata and controls
62 lines (49 loc) · 1.6 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
# Allow usage of lowercase ns variable
ifdef ns
NS := $(ns)
endif
NS ?= prod
.PHONY: db-secret update-db-secret nats-secret update-nats-secret argocd argocd-password apply-root-app setup destroy
db-secret:
@chmod +x scripts/manage-db-secret.sh
@./scripts/manage-db-secret.sh create $(NS)
update-db-secret:
@chmod +x scripts/manage-db-secret.sh
@./scripts/manage-db-secret.sh update $(NS)
nats-secret:
@chmod +x scripts/manage-nats-secret.sh
@./scripts/manage-nats-secret.sh create $(NS)
update-nats-secret:
@chmod +x scripts/manage-nats-secret.sh
@./scripts/manage-nats-secret.sh update $(NS)
argocd:
@chmod +x scripts/install-argocd.sh
@./scripts/install-argocd.sh
argocd-password:
@chmod +x scripts/get-argocd-password.sh
@./scripts/get-argocd-password.sh
get-argocd-password: argocd-password
apply-root-app:
@chmod +x scripts/apply-root-app.sh
@./scripts/apply-root-app.sh $(NS)
setup: argocd
@echo "Setting up secrets for namespace $(NS)..."
@if kubectl get secret postgres-auth-secret -n $(NS) >/dev/null 2>&1; then \
echo "postgres-auth-secret exists, updating..."; \
$(MAKE) update-db-secret NS=$(NS); \
else \
echo "postgres-auth-secret missing, creating..."; \
$(MAKE) db-secret NS=$(NS); \
fi
@if kubectl get secret nats-secret -n $(NS) >/dev/null 2>&1; then \
echo "nats-secret exists, updating..."; \
$(MAKE) update-nats-secret NS=$(NS); \
else \
echo "nats-secret missing, creating..."; \
$(MAKE) nats-secret NS=$(NS); \
fi
@echo "Applying root app for $(NS)..."
@$(MAKE) apply-root-app NS=$(NS)
destroy:
@chmod +x scripts/destroy-env.sh
@./scripts/destroy-env.sh $(NS)