From 449996f4a0c888c5fe55bbabddd4d0dc7e352c0a Mon Sep 17 00:00:00 2001 From: Praful Rakhade Date: Wed, 3 Dec 2025 17:32:07 +0530 Subject: [PATCH 01/11] [MOSIP-43640] Update workflow to include postgres-upgrade job Signed-off-by: Praful Rakhade --- .github/workflows/push-trigger.yml | 58 +++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push-trigger.yml b/.github/workflows/push-trigger.yml index 1cbc66f..9587322 100644 --- a/.github/workflows/push-trigger.yml +++ b/.github/workflows/push-trigger.yml @@ -1,4 +1,4 @@ -name: Build postgres-init and masterdata-loader +name: Build postgres-init, postgres-upgrade and masterdata-loader on: release: @@ -18,6 +18,7 @@ on: - 1.* - develop - release* + - MOSIP* jobs: build-dockers: @@ -39,3 +40,58 @@ jobs: ACTOR_DOCKER_HUB: ${{ secrets.ACTOR_DOCKER_HUB }} RELEASE_DOCKER_HUB: ${{ secrets.RELEASE_DOCKER_HUB }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_DEVOPS }} + + get-db-upgrade-scripts: + runs-on: ubuntu-latest + env: + SERVICE_LOCATION: 'postgres-upgrade' + BUILD_ARTIFACT: 'postgres-upgrade-scripts' + steps: + - name: checkout + uses: actions/checkout@v3 + + - name: Setup branch and env + run: | + # Strip git ref prefix from version + echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV + echo "GPG_TTY=$(tty)" >> $GITHUB_ENV + + - name: Clone DB upgrade scripts + run: | + cd ${{ env.SERVICE_LOCATION }} + bash ./get_db_data.sh ${{ env.BRANCH_NAME }} + - name: Ready the DB upgrade scripts + if: ${{ !contains(github.ref, 'master') || !contains(github.ref, 'main') }} + run: | + cd ${{ env.SERVICE_LOCATION }} + find ./repos/*/db_upgrade_scripts/ -type f -exec zip ${{ env.BUILD_ARTIFACT }}.zip {} + + + - name: Upload the upgrade scripts + if: ${{ !contains(github.ref, 'master') || !contains(github.ref, 'main') }} + uses: actions/upload-artifact@v4 + with: + name: ${{ env.BUILD_ARTIFACT }} + path: ${{ env.SERVICE_LOCATION }}/${{ env.BUILD_ARTIFACT }}.zip + + build-upgrade-dockers: + needs: get-db-upgrade-scripts + strategy: + matrix: + include: + - SERVICE_LOCATION: 'postgres-upgrade' + SERVICE_NAME: 'postgres-upgrade' + BUILD_ARTIFACT: 'postgres-upgrade-scripts' + ONLY_DOCKER: true + fail-fast: false + name: ${{ matrix.SERVICE_NAME }} + uses: mosip/kattu/.github/workflows/docker-build.yml@master + with: + SERVICE_LOCATION: ${{ matrix.SERVICE_LOCATION }} + SERVICE_NAME: ${{ matrix.SERVICE_NAME }} + BUILD_ARTIFACT: ${{ matrix.BUILD_ARTIFACT }} + ONLY_DOCKER: ${{ matrix.ONLY_DOCKER }} + secrets: + DEV_NAMESPACE_DOCKER_HUB: ${{ secrets.DEV_NAMESPACE_DOCKER_HUB }} + ACTOR_DOCKER_HUB: ${{ secrets.ACTOR_DOCKER_HUB }} + RELEASE_DOCKER_HUB: ${{ secrets.RELEASE_DOCKER_HUB }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_DEVOPS }} From 9db1c52d94671de1e9f779d775515cad12fb23ab Mon Sep 17 00:00:00 2001 From: Praful Rakhade Date: Wed, 3 Dec 2025 17:52:46 +0530 Subject: [PATCH 02/11] [MOSIP-43640] Update workflow to include postgres-upgrade job Signed-off-by: Praful Rakhade --- postgres-upgrade/get_db_data.sh | 46 ++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/postgres-upgrade/get_db_data.sh b/postgres-upgrade/get_db_data.sh index 94b02d8..e947fa0 100755 --- a/postgres-upgrade/get_db_data.sh +++ b/postgres-upgrade/get_db_data.sh @@ -7,13 +7,53 @@ while IFS= read -r line; do fi if [ $REPO_NAME == "mosip-compliance-toolkit" ] then - branch=release-1.3.0 + branch=v1.3.2 git clone -b $branch https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME elif [ $REPO_NAME == "esignet" ] - branch=release-1.2.x + then + branch=v1.3.0 + git clone -b $branch https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME + elif [ $REPO_NAME == "commons" ] + then + branch=v1.2.0.1 + git clone -b $branch https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME + elif [ $REPO_NAME == "id-authentication" ] + then + branch=v1.2.0.1 + git clone -b $branch https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME + elif [ $REPO_NAME == "keymanager" ] + then + branch=v1.2.0.1 + git clone -b $branch https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME + elif [ $REPO_NAME == "audit-manager" ] + then + branch=v1.2.0.1 + git clone -b $branch https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME + elif [ $REPO_NAME == "admin-services" ] + then + branch=v1.2.0.1 + git clone -b $branch https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME + elif [ $REPO_NAME == "id-repository" ] + then + branch=v1.2.0.1 + git clone -b $branch https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME + elif [ $REPO_NAME == "partner-management-services" ] + then + branch=v1.2.0.1 + git clone -b $branch https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME + elif [ $REPO_NAME == "pre-registration" ] + then + branch=v1.2.0.1 + git clone -b $branch https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME + elif [ $REPO_NAME == "registration" ] + then + branch=v1.2.0.1 + git clone -b $branch https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME + elif [ $REPO_NAME == "resident-services" ] + then + branch=v1.2.0.1 git clone -b $branch https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME else git clone -b $1 https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME fi done < ./repo-list.txt - From 63d926ecf472e809551b1b37892ea3645b4dc89e Mon Sep 17 00:00:00 2001 From: Praful Rakhade Date: Wed, 3 Dec 2025 17:54:41 +0530 Subject: [PATCH 03/11] [MOSIP-43640] Update workflow to include postgres-upgrade job Signed-off-by: Praful Rakhade --- postgres-upgrade/get_db_data.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/postgres-upgrade/get_db_data.sh b/postgres-upgrade/get_db_data.sh index e947fa0..5df6c6a 100755 --- a/postgres-upgrade/get_db_data.sh +++ b/postgres-upgrade/get_db_data.sh @@ -11,31 +11,31 @@ while IFS= read -r line; do git clone -b $branch https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME elif [ $REPO_NAME == "esignet" ] then - branch=v1.3.0 + branch=v1.6.2 git clone -b $branch https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME elif [ $REPO_NAME == "commons" ] then - branch=v1.2.0.1 + branch=release-1.3.x git clone -b $branch https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME elif [ $REPO_NAME == "id-authentication" ] then - branch=v1.2.0.1 + branch=release-1.3.x git clone -b $branch https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME elif [ $REPO_NAME == "keymanager" ] then - branch=v1.2.0.1 + branch=release-1.3.x git clone -b $branch https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME elif [ $REPO_NAME == "audit-manager" ] then - branch=v1.2.0.1 + branch=release-1.3.x git clone -b $branch https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME elif [ $REPO_NAME == "admin-services" ] then - branch=v1.2.0.1 + branch=release-1.3.x git clone -b $branch https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME elif [ $REPO_NAME == "id-repository" ] then - branch=v1.2.0.1 + branch=release-1.3.x git clone -b $branch https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME elif [ $REPO_NAME == "partner-management-services" ] then @@ -43,15 +43,15 @@ while IFS= read -r line; do git clone -b $branch https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME elif [ $REPO_NAME == "pre-registration" ] then - branch=v1.2.0.1 + branch=release-1.3.x git clone -b $branch https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME elif [ $REPO_NAME == "registration" ] then - branch=v1.2.0.1 + branch=release-1.3.x git clone -b $branch https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME elif [ $REPO_NAME == "resident-services" ] then - branch=v1.2.0.1 + branch=release-1.3.x git clone -b $branch https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME else git clone -b $1 https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME From 0eeee6a8b6a9326fe0e0de5631da4b984d0ea78d Mon Sep 17 00:00:00 2001 From: Praful Rakhade Date: Wed, 3 Dec 2025 17:55:28 +0530 Subject: [PATCH 04/11] Update repository list for PostgreSQL upgrade Signed-off-by: Praful Rakhade --- postgres-upgrade/repo-list.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/postgres-upgrade/repo-list.txt b/postgres-upgrade/repo-list.txt index 7d83c57..ff49297 100644 --- a/postgres-upgrade/repo-list.txt +++ b/postgres-upgrade/repo-list.txt @@ -9,6 +9,4 @@ id-repository partner-management-services pre-registration registration -resident -otp-manager -digital-card-service +resident-services From b1626b4ec059bd93f65bb1da9e6ee84f89937002 Mon Sep 17 00:00:00 2001 From: Praful Rakhade Date: Wed, 3 Dec 2025 18:02:01 +0530 Subject: [PATCH 05/11] Add digital-card-service to repo list Signed-off-by: Praful Rakhade --- postgres-upgrade/repo-list.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/postgres-upgrade/repo-list.txt b/postgres-upgrade/repo-list.txt index ff49297..38317ca 100644 --- a/postgres-upgrade/repo-list.txt +++ b/postgres-upgrade/repo-list.txt @@ -10,3 +10,4 @@ partner-management-services pre-registration registration resident-services +digital-card-service From 81a47e3b31d6bfb5216763e050856563613ddcb0 Mon Sep 17 00:00:00 2001 From: Praful Rakhade Date: Wed, 3 Dec 2025 18:05:22 +0530 Subject: [PATCH 06/11] Add branch handling for digital-card-service Signed-off-by: Praful Rakhade --- postgres-upgrade/get_db_data.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/postgres-upgrade/get_db_data.sh b/postgres-upgrade/get_db_data.sh index 5df6c6a..8045b49 100755 --- a/postgres-upgrade/get_db_data.sh +++ b/postgres-upgrade/get_db_data.sh @@ -53,6 +53,10 @@ while IFS= read -r line; do then branch=release-1.3.x git clone -b $branch https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME + elif [ $REPO_NAME == "digital-card-service" ] + then + branch=release-1.3.x + git clone -b $branch https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME else git clone -b $1 https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME fi From 83ea08be12fe937b429f9d826624d5a821f4d881 Mon Sep 17 00:00:00 2001 From: Praful Rakhade Date: Wed, 3 Dec 2025 18:20:14 +0530 Subject: [PATCH 07/11] Update get_db_data.sh Signed-off-by: Praful Rakhade --- postgres-upgrade/get_db_data.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/postgres-upgrade/get_db_data.sh b/postgres-upgrade/get_db_data.sh index 8045b49..6c9a089 100755 --- a/postgres-upgrade/get_db_data.sh +++ b/postgres-upgrade/get_db_data.sh @@ -39,7 +39,7 @@ while IFS= read -r line; do git clone -b $branch https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME elif [ $REPO_NAME == "partner-management-services" ] then - branch=v1.2.0.1 + branch=v1.2.2.2 git clone -b $branch https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME elif [ $REPO_NAME == "pre-registration" ] then From e0d483be77dbe7e0c9ca797700c9abd676c19611 Mon Sep 17 00:00:00 2001 From: Praful Rakhade Date: Wed, 3 Dec 2025 18:45:56 +0530 Subject: [PATCH 08/11] Update push-trigger.yml Signed-off-by: Praful Rakhade --- .github/workflows/push-trigger.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-trigger.yml b/.github/workflows/push-trigger.yml index 9587322..01badda 100644 --- a/.github/workflows/push-trigger.yml +++ b/.github/workflows/push-trigger.yml @@ -45,7 +45,7 @@ jobs: runs-on: ubuntu-latest env: SERVICE_LOCATION: 'postgres-upgrade' - BUILD_ARTIFACT: 'postgres-upgrade-scripts' + BUILD_ARTIFACT: 'postgres-upgrade' steps: - name: checkout uses: actions/checkout@v3 From 948f7daa4f35be1309c5b83a0454a5419a40952f Mon Sep 17 00:00:00 2001 From: Praful Rakhade Date: Wed, 3 Dec 2025 18:49:17 +0530 Subject: [PATCH 09/11] Update push-trigger.yml Signed-off-by: Praful Rakhade --- .github/workflows/push-trigger.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-trigger.yml b/.github/workflows/push-trigger.yml index 01badda..9587322 100644 --- a/.github/workflows/push-trigger.yml +++ b/.github/workflows/push-trigger.yml @@ -45,7 +45,7 @@ jobs: runs-on: ubuntu-latest env: SERVICE_LOCATION: 'postgres-upgrade' - BUILD_ARTIFACT: 'postgres-upgrade' + BUILD_ARTIFACT: 'postgres-upgrade-scripts' steps: - name: checkout uses: actions/checkout@v3 From 7683432db91ec4af5d69b30de003bda807717587 Mon Sep 17 00:00:00 2001 From: Praful Rakhade Date: Wed, 3 Dec 2025 18:56:08 +0530 Subject: [PATCH 10/11] Update repo-list.txt Signed-off-by: Praful Rakhade --- postgres-upgrade/repo-list.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/postgres-upgrade/repo-list.txt b/postgres-upgrade/repo-list.txt index 38317ca..d14c836 100644 --- a/postgres-upgrade/repo-list.txt +++ b/postgres-upgrade/repo-list.txt @@ -11,3 +11,4 @@ pre-registration registration resident-services digital-card-service +otp-manager From 293db54e5f82072a5988da56fbc36443ddeddc57 Mon Sep 17 00:00:00 2001 From: Praful Rakhade Date: Wed, 3 Dec 2025 19:10:08 +0530 Subject: [PATCH 11/11] Update get_db_data.sh Signed-off-by: Praful Rakhade --- postgres-upgrade/get_db_data.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/postgres-upgrade/get_db_data.sh b/postgres-upgrade/get_db_data.sh index 6c9a089..cbb3609 100755 --- a/postgres-upgrade/get_db_data.sh +++ b/postgres-upgrade/get_db_data.sh @@ -57,6 +57,10 @@ while IFS= read -r line; do then branch=release-1.3.x git clone -b $branch https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME + elif [ $REPO_NAME == "otp-manager" ] + then + branch=release-1.3.x + git clone -b $branch https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME else git clone -b $1 https://github.com/mosip/$REPO_NAME.git ./repos/$REPO_NAME fi