From dbe5d8797dcac2bdc987acd34e8c9e907c114558 Mon Sep 17 00:00:00 2001 From: ckm007 Date: Wed, 17 Jul 2024 22:53:01 +0530 Subject: [PATCH 1/3] [MOSIP-34233] correct helm chart version for resident service Signed-off-by: ckm007 --- helm/resident/.gitignore | 1 + helm/resident/Chart.yaml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/helm/resident/.gitignore b/helm/resident/.gitignore index ee3892e8794..b3c94bf6431 100644 --- a/helm/resident/.gitignore +++ b/helm/resident/.gitignore @@ -1 +1,2 @@ charts/ +Charts.lock diff --git a/helm/resident/Chart.yaml b/helm/resident/Chart.yaml index d2da464106f..3f82e9bb973 100644 --- a/helm/resident/Chart.yaml +++ b/helm/resident/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: resident description: A Helm chart for MOSIP Resident service type: application -version: 12.1.0 +version: 12.1.0-develop appVersion: "" dependencies: - name: common From cce1ab84dc15eba166f233625f835d0b2aab1cfc Mon Sep 17 00:00:00 2001 From: ckm007 Date: Wed, 17 Jul 2024 22:57:37 +0530 Subject: [PATCH 2/3] [MOSIP-34233] updated helm chart version for resident service installation Signed-off-by: ckm007 --- deploy/copy_cm.sh | 3 +++ deploy/copy_cm_func.sh | 33 --------------------------------- deploy/copy_secrets.sh | 3 +++ deploy/delete.sh | 4 +--- deploy/install.sh | 4 ++-- 5 files changed, 9 insertions(+), 38 deletions(-) delete mode 100755 deploy/copy_cm_func.sh diff --git a/deploy/copy_cm.sh b/deploy/copy_cm.sh index ed5e8d6ff5f..92a2db2d680 100755 --- a/deploy/copy_cm.sh +++ b/deploy/copy_cm.sh @@ -3,9 +3,12 @@ # DST_NS: Destination namespace function copying_cm() { + UTIL_URL=https://github.com/mosip/mosip-infra/blob/master/deployment/v3/utils/copy_cm_func.sh COPY_UTIL=./copy_cm_func.sh DST_NS=resident + wget -q $UTIL_URL -O copy_cm_func.sh && chmod +x copy_cm_func.sh + $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 diff --git a/deploy/copy_cm_func.sh b/deploy/copy_cm_func.sh deleted file mode 100755 index 7b22594860e..00000000000 --- a/deploy/copy_cm_func.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh -# Copy configmap and secret from one namespace to another. -# ./copy_cm_func.sh [name] -# Parameters: -# resource: configmap|secret -# name: Optional new name of the configmap or secret in destination namespace. This may be needed if there is -# clash of names - -if [ $1 = "configmap" ] -then - RESOURCE=configmap -elif [ $1 = "secret" ] -then - RESOURCE=secret -else - echo "Incorrect resource $1. Exiting.." - exit 1 -fi - - -if [ $# -ge 5 ] -then - kubectl -n $4 delete --ignore-not-found=true $RESOURCE $5 - kubectl -n $3 get $RESOURCE $2 -o yaml | sed "s/namespace: $3/namespace: $4/g" | sed "s/name: $2/name: $5/g" | kubectl -n $4 create -f - -else - kubectl -n $4 delete --ignore-not-found=true $RESOURCE $2 - kubectl -n $3 get $RESOURCE $2 -o yaml | sed "s/namespace: $3/namespace: $4/g" | kubectl -n $4 create -f - -fi - - - - - diff --git a/deploy/copy_secrets.sh b/deploy/copy_secrets.sh index 38a3e0ae8bb..0496d42fdb6 100755 --- a/deploy/copy_secrets.sh +++ b/deploy/copy_secrets.sh @@ -3,9 +3,12 @@ # DST_NS: Destination namespace function copying_secrets() { + UTIL_URL=https://github.com/mosip/mosip-infra/blob/master/deployment/v3/utils/copy_cm_func.sh COPY_UTIL=./copy_cm_func.sh DST_NS=resident + wget -q $UTIL_URL -O copy_cm_func.sh && chmod +x copy_cm_func.sh + $COPY_UTIL secret keycloak-client-secrets keycloak $DST_NS return 0 } diff --git a/deploy/delete.sh b/deploy/delete.sh index 835e17590dd..a6ff311f39d 100755 --- a/deploy/delete.sh +++ b/deploy/delete.sh @@ -8,8 +8,6 @@ function deleting_resident() { if [ $yn = "Y" ] then helm -n $NS delete resident - helm -n $NS delete mimoto - helm -n $NS delete resident-ui break else break @@ -24,4 +22,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_resident # calling function \ No newline at end of file +deleting_resident # calling function diff --git a/deploy/install.sh b/deploy/install.sh index 452b4e40ff2..80daa4512c6 100755 --- a/deploy/install.sh +++ b/deploy/install.sh @@ -7,7 +7,7 @@ if [ $# -ge 1 ] ; then fi NS=resident -CHART_VERSION=12.1.0 +CHART_VERSION=12.1.0-develop echo Create $NS namespace kubectl create ns $NS @@ -24,7 +24,7 @@ function installing_resident() { echo Copy secrets sed -i 's/\r$//' copy_secrets.sh ./copy_secrets.sh - + echo Setting up dummy values for Resident OIDC Client ID kubectl create secret generic resident-oidc-onboarder-key -n $NS --from-literal=resident-oidc-clientid='' --dry-run=client -o yaml | kubectl apply -f - ./copy_cm_func.sh secret resident-oidc-onboarder-key resident config-server From 1fdfdf60106120628da74ce9473120d8800d13b4 Mon Sep 17 00:00:00 2001 From: ckm007 Date: Wed, 17 Jul 2024 22:58:27 +0530 Subject: [PATCH 3/3] [MOSIP-34233] added helm lint and publish workflow Signed-off-by: ckm007 --- .github/workflows/chart-lint-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/chart-lint-publish.yml b/.github/workflows/chart-lint-publish.yml index 878861a9d65..c8d6ba3bd31 100644 --- a/.github/workflows/chart-lint-publish.yml +++ b/.github/workflows/chart-lint-publish.yml @@ -37,10 +37,9 @@ on: - 1.* - 0.* - develop - - MOSIP* - release* paths: - - './helm/**' + - 'helm/**' jobs: chart-lint-publish: @@ -57,6 +56,7 @@ jobs: LINTING_LINTCONF_YAML_URL: "https://raw.githubusercontent.com/mosip/kattu/master/.github/helm-lint-configs/lintconf.yaml" LINTING_CHART_TESTING_CONFIG_YAML_URL: "https://raw.githubusercontent.com/mosip/kattu/master/.github/helm-lint-configs/chart-testing-config.yaml" LINTING_HEALTH_CHECK_SCHEMA_YAML_URL: "https://raw.githubusercontent.com/mosip/kattu/master/.github/helm-lint-configs/health-check-schema.yaml" + DEPENDENCIES: "mosip,https://mosip.github.io/mosip-helm;" secrets: TOKEN: ${{ secrets.ACTION_PAT }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}