forked from caitlinelfring/argocd-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (46 loc) · 1.73 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
production:
@argocd app create $@ \
--dest-namespace argocd \
--dest-server https://kubernetes.default.svc \
--repo https://github.com/caitlin615/argocd-demo.git \
--path apps \
--helm-set environment=$@
pre-production:
@argocd app create $@ \
--dest-namespace argocd \
--dest-server https://kubernetes.default.svc \
--repo https://github.com/caitlin615/argocd-demo.git \
--path apps \
--helm-set environment=$@
sync-pre-production:
@argocd app sync pre-production
@argocd app sync -l argocd.argoproj.io/instance=pre-production
sync-production:
@argocd app sync production
@argocd app sync -l argocd.argoproj.io/instance=production
deploy: pre-production production
sync: sync-pre-production sync-production
delete-pre-production:
@argocd app delete pre-production
delete-production:
@argocd app delete production
delete: delete-pre-production delete-production
.PHONY: production sync-production \
delete-pre-production delete-production \
pre-production sync-pre-production \
deploy sync delete \
init deinit \
init-argocd deinit-argocd \
watch
init: init-argocd
deinit: delete deinit-argocd
init-argocd:
@helm3 repo add argo https://argoproj.github.io/argo-helm
@kubectl create namespace argocd --dry-run=client -o yaml | kubectl apply -f -
@helm3 install argocd --namespace argocd argo/argo-cd -f argocd-init/values.yaml --wait
@echo "Default argocd admin password, be sure to change it! '$$(kubectl get pods -n argocd -l app.kubernetes.io/name=argocd-server -o name | cut -d'/' -f 2)'"
deinit-argocd:
@helm3 uninstall argocd --namespace argocd
@kubectl delete namespace argocd
watch:
@watch "kubectl get pods -A --sort-by=status.startTime | awk 'NR<2{print \$$0;next}{print \$$0| \"tail -r\"}'"