From 33e13a3a3e4303eca413fcdc6b35c75873f0834a Mon Sep 17 00:00:00 2001 From: Rajesh Rajendran Date: Mon, 17 May 2021 22:03:25 +0530 Subject: [PATCH] chore(deploy): optional nginx https redirect Signed-off-by: Rajesh Rajendran --- scripts/helm/kube-install.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/helm/kube-install.sh b/scripts/helm/kube-install.sh index e3905c2d4..09688780e 100755 --- a/scripts/helm/kube-install.sh +++ b/scripts/helm/kube-install.sh @@ -122,8 +122,11 @@ type() { function app(){ case $1 in nginx) - [[ NGINX_REDIRECT_HTTPS -eq 0 ]] && { - sed -i "/return 301/d" nginx-ingress/nginx-ingress/templates/configmap.yaml + git checkout -- 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 + # Toggles first occurrence of location list include. + sed -i "0,/include \/etc\/nginx\/conf.d\/location.list/s//# include \/etc\/nginx\/conf.d\/location.list/" nginx-ingress\/nginx-ingress\/templates\/configmap.yaml } ansible-playbook -c local setup.yaml -e @vars.yaml -e scale=$installation_type --tags nginx -v exit 0 @@ -170,3 +173,7 @@ done { ansible-playbook -c local setup.yaml -e @vars.yaml -e scale=$installation_type --skip-tags pre-check -v } || exit $? + + + +