diff --git a/deploy/delete-mock.sh b/deploy/delete-mock.sh index 6efa9455..bcb49ecf 100755 --- a/deploy/delete-mock.sh +++ b/deploy/delete-mock.sh @@ -1,26 +1,29 @@ #!/bin/bash -# Uninstalls esignet mock services. -## Usage: ./delete.sh [kubeconfig] +# Uninstalls all esignet mock service helm charts +## Usage: ./delete-mock.sh [kubeconfig] if [ $# -ge 1 ] ; then export KUBECONFIG=$1 fi -Deleting_All() { - MOCK_NS=mockid - NS=esignet - while true; do - read -p "Are you sure you want to delete esignet mock service helm charts?(Y/n) " yn - if [[ $yn = "Y" ]] || [[ $yn = "y" ]]; - then - helm -n $NS delete mock-relying-party-service || true - helm -n $NS delete mock-relying-party-ui || true - helm -n $MOCK_NS delete mock-identity-system || true - break - else - break - fi +ROOT_DIR=`pwd` + +function deleting_mock() { + + declare -a module=("mock-identity-system" + "mock-relying-party-service" + "mock-relying-party-ui" + ) + + echo Installing esignet mock services + + for i in "${module[@]}" + do + cd $ROOT_DIR/"$i" + ./delete.sh done + + echo All esignet mock services deleted sucessfully. return 0 } @@ -30,4 +33,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 -Deleting_All # calling function +deleting_mock # calling function diff --git a/deploy/mock-relying-party-service/install.sh b/deploy/mock-relying-party-service/install.sh index 2e1141d9..9cd73a9b 100755 --- a/deploy/mock-relying-party-service/install.sh +++ b/deploy/mock-relying-party-service/install.sh @@ -26,7 +26,7 @@ function installing_mock-relying-party-service() { CHART_VERSION=0.10.0-develop echo Create $NS namespace - kubectl create ns $NS + kubectl create ns $NS || true echo Istio label kubectl label ns $NS istio-injection=enabled --overwrite diff --git a/deploy/mock-relying-party-ui/install.sh b/deploy/mock-relying-party-ui/install.sh index 6117eba3..b9c3d8a0 100755 --- a/deploy/mock-relying-party-ui/install.sh +++ b/deploy/mock-relying-party-ui/install.sh @@ -38,7 +38,7 @@ function installing_mock-relying-party-ui() { fi echo Create $NS namespace - kubectl create ns $NS + kubectl create ns $NS || true echo Istio label kubectl label ns $NS istio-injection=enabled --overwrite diff --git a/deploy/prereq.sh b/deploy/prereq.sh index 3d1a5648..d041cf53 100755 --- a/deploy/prereq.sh +++ b/deploy/prereq.sh @@ -8,10 +8,12 @@ fi ROOT_DIR=`pwd` NS=mockid +ESIGNET_NS=esignet SOFTHSM_NS=softhsm SOFTHSM_CHART_VERSION=12.0.1 kubectl create ns $NS || true +kubectl create ns $ESIGNET_NS || true function prereq_mockid () { echo Create $SOFTHSM_NS namespace @@ -39,10 +41,10 @@ function prereq_mockid () { function prereq_mockrp () { echo "Create secret for mock-relying-party-service-secrets and jwe-userinfo-private-key delete if exists" - kubectl -n $NS delete --ignore-not-found=true secrets mock-relying-party-private-key-jwk - kubectl -n $NS delete --ignore-not-found=true secrets jwe-userinfo-service-secrets - kubectl -n $NS create secret generic mock-relying-party-private-key-jwk --from-literal=client-private-key='' --dry-run=client -o yaml | kubectl apply -f - - kubectl -n $NS create secret generic jwe-userinfo-service-secrets --from-literal=JWE_USERINFO_PRIVATE_KEY='' --dry-run=client -o yaml | kubectl apply -f - + kubectl -n $ESIGNET_NS delete --ignore-not-found=true secrets mock-relying-party-private-key-jwk + kubectl -n $ESIGNET_NS delete --ignore-not-found=true secrets jwe-userinfo-service-secrets + kubectl -n $ESIGNET_NS create secret generic mock-relying-party-private-key-jwk --from-literal=client-private-key='' --dry-run=client -o yaml | kubectl apply -f - + kubectl -n $ESIGNET_NS create secret generic jwe-userinfo-service-secrets --from-literal=jwe-userinfo-private-key='' --dry-run=client -o yaml | kubectl apply -f - return 0 }