forked from Turbots/tanzu-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path04-configure-gitops.sh
executable file
·63 lines (50 loc) · 3.81 KB
/
04-configure-gitops.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
56
57
58
59
60
61
62
63
#!/usr/bin/env bash
. magic.sh
load_config
echo '----------------------------------------------'
echo ' Configuring GitOps in ArgoCD'
echo '----------------------------------------------'
echo ''
echo 'Continue to switch back to CI/CD Cluster...'
pe "kubectx ${CICD_CLUSTER}"
echo ''
echo '----------------------------------------------'
echo ' Configuring RabbitMQ'
echo '----------------------------------------------'
echo ''
echo 'Continue to configure the RabbitMQ Helm chart in ArgoCD...'
cat kubernetes/cicd/argocd/rabbit.yml | sed "s/WORKLOAD_NAMESPACE/${DEV_DATA_NAMESPACE}/" | sed "s/CLUSTER_URL/${DEV_CLUSTER_URL//\//\\/}/" | sed "s/ENVIRONMENT/development/" | kubectl create -n argocd -f -
cat kubernetes/cicd/argocd/rabbit.yml | sed "s/WORKLOAD_NAMESPACE/${PROD_DATA_NAMESPACE}/" | sed "s/CLUSTER_URL/${PROD_CLUSTER_URL//\//\\/}/" | sed "s/ENVIRONMENT/production/" | kubectl create -n argocd -f -
echo ''
echo '----------------------------------------------'
echo ' Configuring Redis'
echo '----------------------------------------------'
echo ''
echo 'Continue to configure the Redis Helm chart in ArgoCD...'
cat kubernetes/cicd/argocd/redis.yml | sed "s/WORKLOAD_NAMESPACE/${DEV_DATA_NAMESPACE}/" | sed "s/CLUSTER_URL/${DEV_CLUSTER_URL//\//\\/}/" | sed "s/ENVIRONMENT/development/" | kubectl create -n argocd -f -
cat kubernetes/cicd/argocd/redis.yml | sed "s/WORKLOAD_NAMESPACE/${PROD_DATA_NAMESPACE}/" | sed "s/CLUSTER_URL/${PROD_CLUSTER_URL//\//\\/}/" | sed "s/ENVIRONMENT/production/" | kubectl create -n argocd -f -
echo ''
echo '----------------------------------------------'
echo ' Configuring Wavefront Proxy'
echo '----------------------------------------------'
echo ''
echo 'Continue to configure the Redis Helm chart in ArgoCD...'
cat kubernetes/cicd/argocd/wavefront-proxy.yml | sed "s/WORKLOAD_NAMESPACE/${DEV_NAMESPACE}/" | sed "s/CLUSTER_URL/${DEV_CLUSTER_URL//\//\\/}/" | sed "s/ENVIRONMENT/development/" | kubectl create -n argocd -f -
cat kubernetes/cicd/argocd/wavefront-proxy.yml | sed "s/WORKLOAD_NAMESPACE/${PROD_NAMESPACE}/" | sed "s/CLUSTER_URL/${PROD_CLUSTER_URL//\//\\/}/" | sed "s/ENVIRONMENT/production/" | kubectl create -n argocd -f -
echo ''
echo '----------------------------------------------'
echo ' Configuring Applications'
echo '----------------------------------------------'
echo ''
echo 'Continue to configure the applications in ArgoCD...'
cat kubernetes/cicd/argocd/account-service.yml | sed "s/WORKLOAD_NAMESPACE/${DEV_NAMESPACE}/" | sed "s/CLUSTER_URL/${DEV_CLUSTER_URL//\//\\/}/" | sed "s/ENVIRONMENT/development/" | kubectl create -n argocd -f -
cat kubernetes/cicd/argocd/account-service.yml | sed "s/WORKLOAD_NAMESPACE/${PROD_NAMESPACE}/" | sed "s/CLUSTER_URL/${PROD_CLUSTER_URL//\//\\/}/" | sed "s/ENVIRONMENT/production/" | kubectl create -n argocd -f -
cat kubernetes/cicd/argocd/confirmation-service.yml | sed "s/WORKLOAD_NAMESPACE/${DEV_NAMESPACE}/" | sed "s/CLUSTER_URL/${DEV_CLUSTER_URL//\//\\/}/" | sed "s/ENVIRONMENT/development/" | kubectl create -n argocd -f -
cat kubernetes/cicd/argocd/confirmation-service.yml | sed "s/WORKLOAD_NAMESPACE/${PROD_NAMESPACE}/" | sed "s/CLUSTER_URL/${PROD_CLUSTER_URL//\//\\/}/" | sed "s/ENVIRONMENT/production/" | kubectl create -n argocd -f -
cat kubernetes/cicd/argocd/payment-service.yml | sed "s/WORKLOAD_NAMESPACE/${DEV_NAMESPACE}/" | sed "s/CLUSTER_URL/${DEV_CLUSTER_URL//\//\\/}/" | sed "s/ENVIRONMENT/development/" | kubectl create -n argocd -f -
cat kubernetes/cicd/argocd/payment-service.yml | sed "s/WORKLOAD_NAMESPACE/${PROD_NAMESPACE}/" | sed "s/CLUSTER_URL/${PROD_CLUSTER_URL//\//\\/}/" | sed "s/ENVIRONMENT/production/" | kubectl create -n argocd -f -
echo ''
echo '----------------------------------------------'
echo ' GitOps configured successfully!'
echo '----------------------------------------------'
echo ''