diff --git a/deploy/delete.sh b/deploy/delete.sh index acb8380..be1eef9 100755 --- a/deploy/delete.sh +++ b/deploy/delete.sh @@ -3,7 +3,7 @@ function deleting_captcha() { while true; do read -p "Are you sure you want to delete all captcha helm charts?(Y/n) " yn - if [ $yn = "Y" ] + if [[ $yn = "Y" ]] || [[ $yn = "y" ]] then helm -n captcha delete captcha break diff --git a/deploy/install.sh b/deploy/install.sh index daf1952..f46d1ae 100755 --- a/deploy/install.sh +++ b/deploy/install.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Installs captcha-service helm charts +## Installing captcha validation server. ## Usage: ./install.sh [kubeconfig] if [ $# -ge 1 ] ; then @@ -7,23 +7,36 @@ if [ $# -ge 1 ] ; then fi NS=captcha -CHART_VERSION=0.0.1-develop - -echo Create $NS namespace -kubectl create ns $NS +CHART_VERSION=0.1.0-develop function installing_captcha() { + + NS=captcha + CHART_VERSION=0.1.0-develop + + echo Create $NS namespace + kubectl create ns $NS || true + echo Istio label kubectl label ns $NS istio-injection=disabled --overwrite helm repo update - echo Copy configmaps - sed -i 's/\r$//' copy_cm.sh - ./copy_cm.sh + while true; do + read -p "Is Prometheus Service Monitor Operator deployed in the k8s cluster? (y/n): " response + if [[ "$response" == "y" || "$response" == "Y" ]]; then + servicemonitorflag=true + break + elif [[ "$response" == "n" || "$response" == "N" ]]; then + servicemonitorflag=false + break + else + echo "Not a correct response. Please respond with y (yes) or n (no)." + fi + done echo Installing captcha - helm -n $NS install captcha mosip/captcha --version $CHART_VERSION + helm -n $NS install captcha mosip/captcha --version $CHART_VERSION --set metrics.serviceMonitor.enabled=$servicemonitorflag --wait echo Installed captcha service return 0 @@ -35,4 +48,4 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true set -o nounset ## set -u : exit the script if you try to use an uninitialised variable set -o errtrace # trace ERR through 'time command' and other functions set -o pipefail # trace ERR through pipes -installing_captcha # calling function +installing_captcha # calling second function