Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 62 additions & 1 deletion .github/workflows/push-trigger.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build postgres-init and masterdata-loader
name: Build postgres-init, postgres-upgrade and masterdata-loader

on:
release:
Expand All @@ -18,6 +18,7 @@ on:
- 1.*
- develop
- release*
- MOSIP*

jobs:
build-dockers:
Expand All @@ -39,3 +40,63 @@ 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
Comment thread
ckm007 marked this conversation as resolved.

- name: Setup branch and env
run: |
# PR -> target branch, others -> ref_name (branch or tag name)
if [ "${{ github.event_name }}" = "pull_request" ]; then
echo "BRANCH_NAME=${{ github.base_ref }}" >> "$GITHUB_ENV"
else
echo "BRANCH_NAME=${{ github.ref_name }}" >> "$GITHUB_ENV"
fi
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
Comment thread
coderabbitai[bot] marked this conversation as resolved.
if: ${{ (github.event_name == 'pull_request' && github.base_ref != 'master' && github.base_ref != 'main') || (github.event_name != 'pull_request' && github.ref_name != 'master' && github.ref_name != '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: ${{ (github.event_name == 'pull_request' && github.base_ref != 'master' && github.base_ref != 'main') || (github.event_name != 'pull_request' && github.ref_name != 'master' && github.ref_name != '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
if: ${{ (github.event_name == 'pull_request' && github.base_ref != 'master' && github.base_ref != 'main') || (github.event_name != 'pull_request' && github.ref_name != 'master' && github.ref_name != 'main') }}
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 }}
1 change: 0 additions & 1 deletion deploy/chart/README.md

This file was deleted.

23 changes: 0 additions & 23 deletions deploy/chart/istio-addons/.helmignore

This file was deleted.

24 changes: 0 additions & 24 deletions deploy/chart/istio-addons/Chart.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions deploy/chart/istio-addons/templates/gateway.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions deploy/chart/istio-addons/templates/vs.yaml

This file was deleted.

1 change: 0 additions & 1 deletion deploy/chart/istio-addons/values.yaml

This file was deleted.

9 changes: 9 additions & 0 deletions deploy/masterdata-loader/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Contains deployment scripts for masterdata loader

## Masterdata-loader

### Init mosip_master db
* To incorporate your own master data, modify the `install.sh` with your `GithubBranch`, `GithubRepo` and `XlsfolderPath: /home/mosip/<path to xlsx>`.
```bash
./install.sh
```
2 changes: 1 addition & 1 deletion deploy/copy-secrets-masterdata.sh → deploy/masterdata-loader/copy_secret.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# DST_NS: Destination namespace

function copying_secrets() {
UTIL_URL=https://github.com/mosip/mosip-infra/blob/master/deployment/v3/utils/copy_cm_func.sh
UTIL_URL=https://raw.githubusercontent.com/mosip/mosip-infra/master/deployment/v3/utils/copy_cm_func.sh
COPY_UTIL=./copy_cm_func.sh
DST_NS=masterdata-loader

Expand Down
6 changes: 3 additions & 3 deletions deploy/masterdata-install.sh → deploy/masterdata-loader/install.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Loads sample masterdata
# Loads sample masterdata
## Usage: ./install.sh [kubeconfig]

if [ $# -ge 1 ] ; then
Expand Down Expand Up @@ -29,8 +29,8 @@ if [ $yn = "Y" ]
helm repo update

echo Copy configmaps
sed -i 's/\r$//' copy-secrets-masterdata.sh
./copy-secrets-masterdata.sh
sed -i 's/\r$//' copy_secret.sh
./copy_secret.sh
Comment thread
ckm007 marked this conversation as resolved.

echo Loading masterdata
helm -n $NS install masterdata-loader mosip/masterdata-loader \
Expand Down
11 changes: 8 additions & 3 deletions deploy/postgres-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,24 @@ if [ $# -ge 1 ] ; then
fi

NS=postgres
ISTIO_ADDONS_CHART_VERSION=1.0.0

helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add mosip https://mosip.github.io/mosip-helm
helm repo update
Comment thread
ckm007 marked this conversation as resolved.
echo Create $NS namespace
kubectl create namespace $NS
kubectl label ns $NS istio-injection=enabled --overwrite

function installing_postgres() {
echo Installing Postgres
helm -n $NS install postgres bitnami/postgresql --version 13.1.5 -f postgres-values.yaml --wait
helm -n $NS install postgres bitnami/postgresql \
--set image.repository="mosipid/postgresql" \
--set image.tag="16.0.0-debian-11-r13" \
--version 13.1.5 -f postgres-values.yaml --wait
echo Installed Postgres
echo Installing gateways and virtual services
POSTGRES_HOST=$(kubectl get cm global -o jsonpath={.data.mosip-postgres-host})
helm -n $NS install istio-addons chart/istio-addons --set postgresHost=$POSTGRES_HOST --wait
helm -n $NS install istio-addons mosip/istio-addons --version $ISTIO_ADDONS_CHART_VERSION -f postgres-istio-addons-values.yaml --wait
return 0
}

Expand Down
15 changes: 15 additions & 0 deletions deploy/postgres-istio-addons-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
istio:
name: postgres
host: postgres.sandbox.xyz.net
# Note: If you have multiple ingressController then pass it in the form of list.
ingressController: ingressgateway-internal
# Note : By default, if you do **not** specify any gateways, the chart will bind to a single Gateway whose name is derived from the metadata name. If you have mutiple gateways to specify then pass it in the form of list like below.
# gateways:
# - public-gateway
# - internal-gateway
port:
name: tcp-postgresql
number: 5432
protocol: TCP
serviceHost: postgres-postgresql
servicePort: 5432
Loading
Loading