Skip to content

Commit

Permalink
Merge pull request #28 from ckm007/develop
Browse files Browse the repository at this point in the history
[DSD-6382] updated captcha deployment scripts
  • Loading branch information
ase-101 authored Oct 15, 2024
2 parents 9e127e8 + 5e02001 commit 06c1821
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
2 changes: 1 addition & 1 deletion deploy/delete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
33 changes: 23 additions & 10 deletions deploy/install.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,42 @@
#!/bin/bash
# Installs captcha-service helm charts
## Installing captcha validation server.
## Usage: ./install.sh [kubeconfig]

if [ $# -ge 1 ] ; then
export KUBECONFIG=$1
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
Expand All @@ -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

0 comments on commit 06c1821

Please sign in to comment.