From 688f23d8764d2c3a87a1e73775a9eb359df4e4cb Mon Sep 17 00:00:00 2001 From: Rajesh Rajendran Date: Sat, 10 Jul 2021 18:41:36 +0530 Subject: [PATCH] chore(upgrade): change upgrade script Installation of applications handled in the script rather than passing it on to kube-install.sh Signed-off-by: Rajesh Rajendran --- scripts/helm/upgrade.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/scripts/helm/upgrade.sh b/scripts/helm/upgrade.sh index 1ef1b8213..1bdf3d6cd 100644 --- a/scripts/helm/upgrade.sh +++ b/scripts/helm/upgrade.sh @@ -46,11 +46,21 @@ migration(){ ansible-playbook -c local migration.yaml -e @vars.yaml -e migration_versions=${joined_migration_versions} --tags $db -v } } +installation_type=1 echo -e "Migrating postgresql" migration postgresql + # Re installing apps. apps=($(ls app/*.yaml|cut -d "." -f1|cut -d '/' -f2)) -apps+=(frontend nginx) -for app in ${apps}; do - bash -x kube-install.sh --app $app +ansible-playbook -c local setup.yaml -e @vars.yaml -e scale=$installation_type --tags template -v +for app in ${apps[@]}; do + ansible-playbook -c local setup.yaml -e @vars.yaml -e scale=$installation_type -e app_name=$app --tags app --skip-tags template -v done +# Installing frontend +ansible-playbook -c local setup.yaml -e @vars.yaml -e scale=$installation_type --tags frontend -v +# Installing nginx +sed -i 's/.* return 301 .*/ # return 301 https:\/\/$host$request_uri;/g' nginx-ingress/nginx-ingress/templates/configmap.yaml +[[ NGINX_REDIRECT_HTTPS -eq 1 ]] && { +sed -i "s/# return 301/return 301/g" nginx-ingress/nginx-ingress/templates/configmap.yaml +} +ansible-playbook -c local setup.yaml -e @vars.yaml -e scale=$installation_type --tags nginx -v