Skip to content

Commit

Permalink
Resolved merge conflicts
Browse files Browse the repository at this point in the history
Signed-off-by: Mohanachandran S <[email protected]>
  • Loading branch information
mohanachandran-s committed Jan 10, 2025
2 parents 795bb97 + bcf1838 commit 51e4169
Show file tree
Hide file tree
Showing 136 changed files with 4,088 additions and 1,879 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/push-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
settings-path: ${{ github.workspace }} # location for the settings.xml file

- name: Cache local Maven repository
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
Expand Down
16 changes: 16 additions & 0 deletions deploy/pmp-revamp-ui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Partner Management portal

## Install
```sh
./install.sh
```

## Restart
```sh
./restart.sh
```

## Delete
```sh
./delete.sh
```
30 changes: 30 additions & 0 deletions deploy/pmp-revamp-ui/delete.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
# Uninstalls all pms ui helm charts
## Usage: ./delete.sh [kubeconfig]

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

function deleting_pmp_ui() {
NS=pms
while true; do
read -p "Are you sure you want to delete all pms helm charts?(Y/n) " yn
if [ $yn = "Y" ]
then
helm -n $NS delete pmp-revamp-ui
break
else
break
fi
done
return 0
}

# set commands for error handling.
set -e
set -o errexit ## set -e : exit the script if any statement returns a non-true return value
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_pmp_ui # calling function
53 changes: 53 additions & 0 deletions deploy/pmp-revamp-ui/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash
# Installs all PMS UI charts
## Usage: ./install.sh [kubeconfig]

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

NS=pms
CHART_VERSION=0.0.1-develop
COPY_UTIL=../copy_cm_func.sh

echo Create $NS namespace
kubectl create ns $NS

function installing_pmp_revamp_ui() {
echo Istio label
kubectl label ns $NS istio-injection=enabled --overwrite
helm repo update

echo Copy configmaps
$COPY_UTIL configmap global default $NS
$COPY_UTIL configmap artifactory-share artifactory $NS
$COPY_UTIL configmap config-server-share config-server $NS

INTERNAL_API_HOST=$(kubectl get cm global -o jsonpath={.data.mosip-api-internal-host})
PMP_REVAMP_UI_HOST=$(kubectl get cm global -o jsonpath={.data.mosip-pmp-revamp-ui-host})

PARTNER_MANAGER_SERVICE_NAME="pms-partner"
POLICY_MANAGER_SERVICE_NAME="pms-policy"

echo Installing pmp-revamp-ui
helm -n $NS install pmp-revamp-ui mosip/pmp-revamp-ui \
--set pmp_revamp.react_app_partner_manager_api_base_url="https://$INTERNAL_API_HOST/v1/partnermanager" \
--set pmp_revamp.react_app_policy_manager_api_base_url="https://$INTERNAL_API_HOST/v1/policymanager" \
--set pmp_revamp.pms_partner_manager_internal_service_url="http://$PARTNER_MANAGER_SERVICE_NAME.$NS/v1/partnermanager" \
--set pmp_revamp.pms_policy_manager_internal_service_url="http://$POLICY_MANAGER_SERVICE_NAME.$NS/v1/policymanager" \
--set istio.hosts=["$PMP_REVAMP_UI_HOST"] --version $CHART_VERSION

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

echo Installed pmp-revamp-ui services

return 0
}

# set commands for error handling.
set -e
set -o errexit ## set -e : exit the script if any statement returns a non-true return value
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_pmp_revamp_ui # calling function
25 changes: 25 additions & 0 deletions deploy/pmp-revamp-ui/restart.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
# Restart the pms services
## Usage: ./restart.sh [kubeconfig]

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

function Restarting_pmp_ui() {
NS=pms
kubectl -n $NS rollout restart deploy

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

echo Restarted pmp ui services
return 0
}

# set commands for error handling.
set -e
set -o errexit ## set -e : exit the script if any statement returns a non-true return value
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
Restarting_pmp_ui # calling function
1 change: 0 additions & 1 deletion deploy/pmp-ui/delete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ function deleting_pmp_ui() {
if [ $yn = "Y" ]
then
helm -n $NS delete pmp-ui
helm -n $NS delete pmp-revamp-ui
break
else
break
Expand Down
12 changes: 0 additions & 12 deletions deploy/pmp-ui/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,10 @@ function installing_pmp_ui() {

INTERNAL_API_HOST=$(kubectl get cm global -o jsonpath={.data.mosip-api-internal-host})
PMP_HOST=$(kubectl get cm global -o jsonpath={.data.mosip-pmp-host})
PMP_NEW_HOST=$(kubectl get cm global -o jsonpath={.data.mosip-pmp-revamp-ui-new-host})

PARTNER_MANAGER_SERVICE_NAME="pms-partner"
POLICY_MANAGER_SERVICE_NAME="pms-policy"

echo Installing pmp-ui
helm -n $NS install pmp-ui mosip/pmp-ui --set pmp.apiUrl=https://$INTERNAL_API_HOST/ --set istio.hosts=["$PMP_HOST"] --version $CHART_VERSION

echo Installing pmp-revamp-ui-new
helm -n $NS install pmp-revamp-ui mosip/pmp-revamp-ui \
--set pmp_new.react_app_partner_manager_api_base_url="https://$INTERNAL_API_HOST/v1/partnermanager" \
--set pmp_new.react_app_policy_manager_api_base_url="https://$INTERNAL_API_HOST/v1/policymanager" \
--set pmp_new.pms_partner_manager_internal_service_url="http://$PARTNER_MANAGER_SERVICE_NAME.$NS/v1/partnermanager" \
--set pmp_new.pms_policy_manager_internal_service_url="http://$POLICY_MANAGER_SERVICE_NAME.$NS/v1/policymanager" \
--set istio.hosts=["$PMP_NEW_HOST"] --version $CHART_VERSION

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

echo Installed pmp ui services
Expand Down
41 changes: 27 additions & 14 deletions helm/pmp-revamp-ui/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 +3,69 @@ kind: ConfigMap
metadata:
name: {{ template "common.names.fullname" . }}
namespace: {{ .Release.Namespace }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
labels:
{{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
annotations:
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
data:
REACT_APP_PARTNER_MANAGER_API_BASE_URL: {{ .Values.pmp_revamp.pms_partner_manager_internal_service_url }}
REACT_APP_POLICY_MANAGER_API_BASE_URL: {{ .Values.pmp_revamp.pms_policy_manager_internal_service_url }}
default.conf: |
server {
listen 3000;
server_name localhost;
add_header X-Frame-Options DENY;
location / {
root /usr/share/nginx/html;
}
}
nginx.conf: |-
worker_processes 1;
events {
worker_connections 1024;
}
http {
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
server {
listen 3000;
server_name localhost;
root /usr/share/nginx/html;
index index.html index.htm;
include /etc/nginx/mime.types;
gzip on;
gzip_min_length 1000;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
location /v1/partnermanager {
proxy_pass {{ .Values.pmp_new.pms_partner_manager_internal_service_url }};
proxy_pass {{ .Values.pmp_revamp.pms_partner_manager_internal_service_url }};
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
location /v1/policymanager {
proxy_pass {{ .Values.pmp_new.pms_policy_manager_internal_service_url }};
proxy_pass {{ .Values.pmp_revamp.pms_policy_manager_internal_service_url }};
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
location / {
# alias /usr/share/nginx/html;
try_files $uri $uri/ /index.html;
}
}
Expand Down
4 changes: 2 additions & 2 deletions helm/pmp-revamp-ui/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ spec:
- name: JDK_JAVA_OPTIONS
value: {{ .Values.additionalResources.javaOpts }}
- name: REACT_APP_PARTNER_MANAGER_API_BASE_URL
value: {{ .Values.pmp_new.react_app_partner_manager_api_base_url }}
value: {{ .Values.pmp_revamp.react_app_partner_manager_api_base_url }}
- name: REACT_APP_POLICY_MANAGER_API_BASE_URL
value: {{ .Values.pmp_new.react_app_policy_manager_api_base_url }}
value: {{ .Values.pmp_revamp.react_app_policy_manager_api_base_url }}
{{- if .Values.extraEnvVars }}
{{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }}
{{- end }}
Expand Down
10 changes: 5 additions & 5 deletions helm/pmp-revamp-ui/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -413,11 +413,11 @@ metrics:
# severity: error
rules: []

pmp_new:
react_app_partner_manager_api_base_url: 'https://api-internal.sandbox.xyz.net/v1/partnermanager'
react_app_policy_manager_api_base_url: 'https://api-internal.sandbox.xyz.net/v1/policymanager'
pms_partner_manager_internal_service_url: 'http://pms-partner.pms/v1/partnermanager'
pms_policy_manager_internal_service_url: 'http://pms-policy.pms/v1/policymanager'
pmp_revamp:
react_app_partner_manager_api_base_url: 'https://$INTERNAL_API_HOST/v1/partnermanager'
react_app_policy_manager_api_base_url: 'https://$INTERNAL_API_HOST/v1/policymanager'
pms_partner_manager_internal_service_url: 'http://$PARTNER_MANAGER_SERVICE_NAME.$NS/v1/partnermanager'
pms_policy_manager_internal_service_url: 'http://$POLICY_MANAGER_SERVICE_NAME.$NS/v1/policymanager'

## The url below is to access pmp API services.
## CAUTION: Domain name to access pmp UI must be secure/internal/over vpn.
Expand Down
Loading

0 comments on commit 51e4169

Please sign in to comment.