Skip to content

Commit

Permalink
Merge pull request #36 from abhishek8shankar/release-0.8.0
Browse files Browse the repository at this point in the history
[DSD-5029] Updated scripts for release-0.8.0
  • Loading branch information
ckm007 authored Apr 25, 2024
2 parents 64e22f4 + 5b79f06 commit 2888a69
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 20 deletions.
4 changes: 2 additions & 2 deletions helm/inji-web/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
name: inji-web
name: injiweb
description: A Helm chart for MOSIP injiweb UI module
type: application
version: 1.0.0
version: 0.0.1
appVersion: ""
dependencies:
- name: common
Expand Down
4 changes: 2 additions & 2 deletions helm/inji-web/copy_cm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

function copying_cm() {
COPY_UTIL=./copy_cm_func.sh
DST_NS=esignet
DST_NS=inijiweb

$COPY_UTIL configmap global default $DST_NS
$COPY_UTIL configmap artifactory-share artifactory $DST_NS
$COPY_UTIL configmap config-server-share config-server $DST_NS
$COPY_UTIL configmap softhsm-esignet-share softhsm $DST_NS
# $COPY_UTIL configmap softhsm-esignet-share softhsm $DST_NS
return 0
}

Expand Down
8 changes: 4 additions & 4 deletions helm/inji-web/delete.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#!/bin/bash
# Uninstalls injiweb-ui helm charts
# Uninstalls injiweb helm charts
## Usage: ./delete.sh [kubeconfig]

if [ $# -ge 1 ] ; then
export KUBECONFIG=$1
fi

function Deleting_injiweb-ui() {
NS=esignet
NS=injiweb
while true; do
read -p "Are you sure you want to delete all esignet helm charts?(Y/n) " yn
read -p "Are you sure you want to delete all injiweb helm charts?(Y/n) " yn
if [ $yn = "Y" ]
then
helm -n $NS delete injiweb-ui
helm -n $NS delete injiweb
break
else
break
Expand Down
44 changes: 36 additions & 8 deletions helm/inji-web/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,38 @@ if [ $# -ge 1 ] ; then
export KUBECONFIG=$1
fi

NS=esignet
CHART_VERSION=1.0.0
NS=injiweb
CHART_VERSION=0.0.1

DEFAULT_MOSIP_INJIWEB_HOST=$( kubectl get cm global -n config-server -o jsonpath={.data.mosip-injiweb-host} )
# Check if MOSIP_INJIWEB_HOST is present under configmap/global of configserver
if echo "$DEFAULT_MOSIP_INJIWEB_HOST" | grep -q "MOSIP_INJIWEB_HOST"; then
echo "MOSIP_INJIWEB_HOST is already present in configmap/global of configserver"
MOSIP_INJIWEB_HOST=DEFAULT_MOSIP_INJIWEB_HOST
else
read -p "Please provide injiwebhost (eg: injiweb.sandbox.xyz.net ) : " MOSIP_INJIWEB_HOST

if [ -z "MOSIP_INJIWEB_HOST" ]; then
echo "INJIWEB Host not provided; EXITING;"
exit 0;
fi
fi

CHK_MOSIP_INJIWEB_HOST=$( nslookup "$MOSIP_INJIWEB_HOST" )
if [ $? -gt 0 ]; then
echo "Injiweb Host does not exists; EXITING;"
exit 0;
fi

echo "MOSIP_INJIWEB_HOST is not present in configmap/global of configserver"
# Add injiweb host to global
kubectl patch configmap global -n config-server --type merge -p "{\"data\": {\"mosip-injiweb-host\": \"$MOSIP_INIEB_HOST\"}}"
# Add the host
kubectl set env deployment/config-server SPRING_CLOUD_CONFIG_SERVER_OVERRIDES_MOSIP_ESIGNET_INJIWEB_HOST=$MOSIP_INJIWEB_HOST -n config-server
# Restart the configserver deployment
kubectl -n config-server get deploy -o name | xargs -n1 -t kubectl -n config-server rollout restart

sleep 400s

echo Create $NS namespace
kubectl create ns $NS
Expand All @@ -20,18 +50,16 @@ function installing_inji-web() {
helm repo update

echo Copy configmaps
# ./copy_cm.sh
./copy_cm.sh

ESIGNET_HOST=$(kubectl get cm global -o jsonpath={.data.mosip-esignet-host})
INJI_HOST=$(kubectl get cm global -o jsonpath={.data.mosip-injiweb-host})
echo Installing INJIWEB
helm -n $NS install inji-web mosip/inji-web \
helm -n $NS install injiweb mosip/inji-web \
-f values.yaml \
--set esignet_redirect_url=$ESIGNET_HOST \
--set istio.hosts\[0\]=$INJI_HOST \
--version $CHART_VERSION

# kubectl -n $NS get deploy -o name | xargs -n1 -t kubectl -n $NS rollout status
kubectl -n $NS get deploy -o name | xargs -n1 -t kubectl -n $NS rollout status

echo Installed inji-web
return 0
Expand All @@ -43,4 +71,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_inji-web # calling function
installing_inji-web # calling function
2 changes: 1 addition & 1 deletion helm/inji-web/restart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if [ $# -ge 1 ] ; then
fi

function Restarting_oidc-ui() {
NS=esignet
NS=injiweb
kubectl -n $NS rollout restart deploy oidc-ui

kubectl -n $NS get deploy -o name | xargs -n1 -t kubectl -n $NS rollout status
Expand Down
6 changes: 3 additions & 3 deletions helm/inji-web/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ extraEnvVarsCM:
- global
- config-server-share
- artifactory-share
- softhsm-esignet-share
- oidc-ui
# - softhsm-esignet-share


## Secret with extra environment variables
##
Expand Down Expand Up @@ -433,5 +433,5 @@ istio:
portName: http
port: 80
hosts:
- inji.sandbox.xyz.net
- injiweb.sandbox.xyz.net
prefix: /

0 comments on commit 2888a69

Please sign in to comment.