forked from Glovo/gitops-basics-workshop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.sh
executable file
·55 lines (49 loc) · 1.37 KB
/
configure.sh
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
#!/bin/bash
ARGOCD_VERSION="v2.8.2"
ARGO_ROLLOUTS_VERSION="v1.6.4"
ARGOCD_DASHBOARD_PORT=8888
# Functions
help() {
echo "Usage: $0 <target>"
echo ""
echo "Targets:"
echo " checkout: Checkout branch and push it with '\$1' name"
echo " setup Install Argo CD and Argo Rollouts"
echo " dashboard Open Argo CD and Argo Rollouts dashboards"
}
checkout() {
git clone https://github.com/Glovo/gitops-basics-workshop.git
cd gitops-basics-workshop || exit 1
git checkout -b "$1-gitops-workshop"
git add .
git commit -m "Rename placeholder with name"
git push -u origin "$1-gitops-workshop"
}
setup() {
kubectl create namespace argocd || true
kubectl apply -n argocd -f "https://raw.githubusercontent.com/argoproj/argo-cd/${ARGOCD_VERSION}/manifests/install.yaml"
kubectl create namespace argo-rollouts || true
kubectl apply -n argo-rollouts -f "https://raw.githubusercontent.com/argoproj/argo-rollouts/${ARGO_ROLLOUTS_VERSION}/manifests/install.yaml"
}
dashboard() {
brew install argoproj/tap/kubectl-argo-rollouts > /dev/null
kubectl argo rollouts dashboard -n argo-rollouts > /dev/null &
echo
kubectl -n argocd port-forward deploy/argocd-server ${ARGOCD_DASHBOARD_PORT}:8080 > /dev/null &
echo
}
# Main logic
case "$1" in
"checkout")
checkout "$2"
;;
"setup")
setup
;;
"dashboard")
dashboard
;;
*)
help
;;
esac