diff --git a/.github/workflows/browserstack-web.yml b/.github/workflows/browserstack-web.yml new file mode 100644 index 00000000..b53e251c --- /dev/null +++ b/.github/workflows/browserstack-web.yml @@ -0,0 +1,26 @@ + name: BrowserStack Web Tests + + on: + workflow_dispatch: + inputs: + message: + description: 'Message for manually triggering' + required: false + default: 'Triggered for Updates' + type: string + + jobs: + inji-web-test: + runs-on: ubuntu-latest + env: + BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} + BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Run tests + run: | + cd inji-web-test + mvn clean test -DtestngXmlFile="TestNg.xml" diff --git a/README.md b/README.md index 29600109..fb00b37d 100644 --- a/README.md +++ b/README.md @@ -52,4 +52,3 @@ $ docker run -it -d -p 3000:3000 : ``` - Open URL http://localhost:3000 - diff --git a/helm/inji-web/Chart.yaml b/helm/inji-web/Chart.yaml index 0af13eac..d4502d1c 100644 --- a/helm/inji-web/Chart.yaml +++ b/helm/inji-web/Chart.yaml @@ -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.8.1 appVersion: "" dependencies: - name: common diff --git a/helm/inji-web/copy_cm.sh b/helm/inji-web/copy_cm.sh index 462711fa..8e261e2c 100755 --- a/helm/inji-web/copy_cm.sh +++ b/helm/inji-web/copy_cm.sh @@ -4,12 +4,12 @@ function copying_cm() { COPY_UTIL=./copy_cm_func.sh - DST_NS=esignet + DST_NS=injiweb $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 } @@ -19,4 +19,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 -copying_cm # calling function \ No newline at end of file +copying_cm # calling function diff --git a/helm/inji-web/delete.sh b/helm/inji-web/delete.sh index 91a9184a..31893849 100755 --- a/helm/inji-web/delete.sh +++ b/helm/inji-web/delete.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Uninstalls injiweb-ui helm charts +# Uninstalls injiweb helm charts ## Usage: ./delete.sh [kubeconfig] if [ $# -ge 1 ] ; then @@ -7,12 +7,12 @@ if [ $# -ge 1 ] ; then 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 diff --git a/helm/inji-web/install.sh b/helm/inji-web/install.sh index 8c745cf5..fecb2ccc 100755 --- a/helm/inji-web/install.sh +++ b/helm/inji-web/install.sh @@ -6,8 +6,39 @@ if [ $# -ge 1 ] ; then export KUBECONFIG=$1 fi -NS=esignet -CHART_VERSION=1.0.0 +NS=injiweb +CHART_VERSION=0.8.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_INJIWEB_HOST\"}}" + kubectl patch configmap global -n default --type merge -p "{\"data\": {\"mosip-injiweb-host\": \"$MOSIP_INJIWEB_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 status + +sleep 400s echo Create $NS namespace kubectl create ns $NS @@ -20,18 +51,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/injiweb \ -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 diff --git a/helm/inji-web/restart.sh b/helm/inji-web/restart.sh index 706a2a4c..f4c357ff 100755 --- a/helm/inji-web/restart.sh +++ b/helm/inji-web/restart.sh @@ -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 diff --git a/helm/inji-web/values.yaml b/helm/inji-web/values.yaml index 042d2308..24c29f9c 100755 --- a/helm/inji-web/values.yaml +++ b/helm/inji-web/values.yaml @@ -51,8 +51,8 @@ service: image: registry: docker.io - repository: mosipdev/inji-web - tag: develop + repository: mosipid/inji-web + tag: 0.8.1 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' @@ -248,8 +248,8 @@ extraEnvVarsCM: - global - config-server-share - artifactory-share - - softhsm-esignet-share - - oidc-ui + # - softhsm-esignet-share + ## Secret with extra environment variables ## @@ -433,5 +433,5 @@ istio: portName: http port: 80 hosts: - - inji.sandbox.xyz.net + - injiweb.sandbox.xyz.net prefix: / diff --git a/inji-web/package-lock.json b/inji-web/package-lock.json index c96aca3f..ae176935 100644 --- a/inji-web/package-lock.json +++ b/inji-web/package-lock.json @@ -7310,11 +7310,11 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -10157,9 +10157,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -28694,11 +28694,11 @@ } }, "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "requires": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" } }, "browser-process-hrtime": { @@ -30768,9 +30768,9 @@ "integrity": "sha512-pjmC+bkIF8XI7fWaH8KxHcZL3DPybs1roSKP4rKDvy20tAWwIObE4+JIseG2byfGKhud5ZnM4YSGKBz7Sh0ndQ==" }, "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "requires": { "to-regex-range": "^5.0.1" }