-
Notifications
You must be signed in to change notification settings - Fork 3
/
configure-bank-of-anthos.sh
executable file
·33 lines (25 loc) · 1.11 KB
/
configure-bank-of-anthos.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
#!/bin/zsh
source repositories.sh
source_repo=${boa_source_repo}
app_name=${boa_app_name}
app_version=${boa_app_version}
registry_type=${1:?"Please specify ECR, GAR, or GCR"}
git clone [email protected]:GoogleCloudPlatform/bank-of-anthos.git
for file in `ls bank-of-anthos/kubernetes-manifests/*.yaml`; sed -i.bak -e '/ENABLE_METRICS/ {n;s/true/false/;:p' -e 'n;bp' -e '}' $file
for file in `ls bank-of-anthos/kubernetes-manifests/*.yaml`; sed -i.bak -e '/ENABLE_TRACING/ {n;s/true/false/;:p' -e 'n;bp' -e '}' $file
case ${registry_type} in
"ECR")
docker_repo="${aws_account}.dkr.ecr.${aws_region}.amazonaws.com"
;;
"GAR")
docker_repo="${gcp_gar_region}-docker.pkg.dev/${gcp_project_id}"
;;
"GCR")
docker_repo="${gcp_gcr_region}gcr.io/${gcp_project_id}"
;;
esac
for file in `ls bank-of-anthos/kubernetes-manifests/*.yaml`; sed -i.bak -e "s#${source_repo}#${docker_repo}#g" $file
# TODO: update manifests to display AWS if running in AWS
kubectl create namespace bankofanthos
kubectl apply -f bank-of-anthos/extras/jwt/jwt-secret.yaml -n bankofanthos
kubectl apply -f bank-of-anthos/kubernetes-manifests -n bankofanthos