Skip to content

Commit

Permalink
Merge pull request #268 from mosip/MOSIP-35816
Browse files Browse the repository at this point in the history
[DSD-6382] updated changes to fix dev testing issues
  • Loading branch information
ckm007 authored Oct 4, 2024
2 parents 0da44ef + 3610acc commit 934fba2
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 23 deletions.
37 changes: 20 additions & 17 deletions deploy/delete-mock.sh
Original file line number Diff line number Diff line change
@@ -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
}

Expand All @@ -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
2 changes: 1 addition & 1 deletion deploy/mock-relying-party-service/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion deploy/mock-relying-party-ui/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 6 additions & 4 deletions deploy/prereq.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 934fba2

Please sign in to comment.