Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
GOKULRAJ136 committed Dec 16, 2024
2 parents 701959c + 52c9f6a commit c296e02
Show file tree
Hide file tree
Showing 752 changed files with 35,046 additions and 2,101 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/chart-lint-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Validate / Publish helm charts

on:
release:
types: [published]
pull_request:
types: [opened, reopened, synchronize]
paths:
- 'helm/**'
workflow_dispatch:
inputs:
IGNORE_CHARTS:
description: 'Provide list of charts to be ignored separated by pipe(|)'
required: false
default: '""'
type: string
CHART_PUBLISH:
description: 'Chart publishing to gh-pages branch'
required: false
default: 'NO'
type: string
options:
- YES
- NO
INCLUDE_ALL_CHARTS:
description: 'Include all charts for Linting/Publishing (YES/NO)'
required: false
default: 'NO'
type: string
options:
- YES
- NO
push:
branches:
- '!release-branch'
- '!master'
- 1.*
- 0.*
- develop
- release*
paths:
- 'helm/**'

jobs:
chart-lint-publish:
uses: mosip/kattu/.github/workflows/chart-lint-publish.yml@master
with:
CHARTS_DIR: ./helm
CHARTS_URL: https://mosip.github.io/mosip-helm
REPOSITORY: mosip-helm
BRANCH: gh-pages
INCLUDE_ALL_CHARTS: "${{ inputs.INCLUDE_ALL_CHARTS || 'NO' }}"
IGNORE_CHARTS: "${{ inputs.IGNORE_CHARTS || '\"\"' }}"
CHART_PUBLISH: "${{ inputs.CHART_PUBLISH || 'YES' }}"
LINTING_CHART_SCHEMA_YAML_URL: "https://raw.githubusercontent.com/mosip/kattu/master/.github/helm-lint-configs/chart-schema.yaml"
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 }}
2 changes: 1 addition & 1 deletion .github/workflows/db-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
- release*
- master
- 1.*
- develop*
- develop
- MOSIP*
paths:
- 'db_scripts/**'
Expand Down
119 changes: 115 additions & 4 deletions .github/workflows/push-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:

jobs:
build-maven-partner:
uses: mosip/kattu/.github/workflows/maven-build.yml@master
uses: mosip/kattu/.github/workflows/maven-build.yml@master-java21
with:
SERVICE_LOCATION: ./partner
BUILD_ARTIFACT: partner
Expand All @@ -36,8 +36,9 @@ jobs:

publish_to_nexus:
if: "${{ !contains(github.ref, 'master') && github.event_name != 'pull_request' && github.event_name != 'release' && github.event_name != 'prerelease' && github.event_name != 'publish' }}"

needs: build-maven-partner
uses: mosip/kattu/.github/workflows/maven-publish-to-nexus.yml@master
uses: mosip/kattu/.github/workflows/maven-publish-to-nexus.yml@master-java21
with:
SERVICE_LOCATION: ./partner
secrets:
Expand All @@ -61,7 +62,7 @@ jobs:
BUILD_ARTIFACT: 'partner'
fail-fast: false
name: ${{ matrix.SERVICE_NAME }}
uses: mosip/kattu/.github/workflows/docker-build.yml@master
uses: mosip/kattu/.github/workflows/docker-build.yml@master-java21
with:
SERVICE_LOCATION: ${{ matrix.SERVICE_LOCATION }}
SERVICE_NAME: ${{ matrix.SERVICE_NAME }}
Expand All @@ -75,7 +76,7 @@ jobs:
sonar_analysis:
needs: build-maven-partner
if: "${{ github.event_name != 'pull_request' }}"
uses: mosip/kattu/.github/workflows/maven-sonar-analysis.yml@master
uses: mosip/kattu/.github/workflows/maven-sonar-analysis.yml@master-java21
with:
SERVICE_LOCATION: ./partner
secrets:
Expand All @@ -86,3 +87,113 @@ jobs:
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
GPG_SECRET: ${{ secrets.GPG_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

build-maven-apitest-pms:
uses: mosip/kattu/.github/workflows/maven-build.yml@master-java21
with:
SERVICE_LOCATION: ./api-test
BUILD_ARTIFACT: apitest-pms
secrets:
OSSRH_USER: ${{ secrets.OSSRH_USER }}
OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
GPG_SECRET: ${{ secrets.GPG_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

publish_to_nexus_apitest_pms:
if: "${{ !contains(github.ref, 'master') && github.event_name != 'pull_request' && github.event_name != 'release' && github.event_name != 'prerelease' && github.event_name != 'publish' }}"
needs: build-maven-apitest-pms
uses: mosip/kattu/.github/workflows/maven-publish-to-nexus.yml@master-java21
with:
SERVICE_LOCATION: ./api-test
secrets:
OSSRH_USER: ${{ secrets.OSSRH_USER }}
OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }}
OSSRH_URL: ${{ secrets.OSSRH_SNAPSHOT_URL }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
GPG_SECRET: ${{ secrets.GPG_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

build-apitest-pms-local:
needs: build-maven-apitest-pms
runs-on: ubuntu-latest
env:
NAMESPACE: ${{ secrets.dev_namespace_docker_hub }}
SERVICE_NAME: apitest-pms
SERVICE_LOCATION: api-test
BUILD_ARTIFACT: apitest-pms-local
steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 21
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Setup the settings file for ossrh server
run: echo "<settings> <servers> <server> <id>ossrh</id> <username>${{secrets.ossrh_user}}</username> <password>${{secrets.ossrh_secret}}</password> </server> </servers> <profiles> <profile> <id>ossrh</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <gpg.executable>gpg2</gpg.executable> <gpg.passphrase>${{secrets.gpg_secret}}</gpg.passphrase> </properties> </profile> <profile> <id>allow-snapshots</id> <activation><activeByDefault>true</activeByDefault></activation> <repositories> <repository> <id>snapshots-repo</id> <url>https://oss.sonatype.org/content/repositories/snapshots</url> <releases><enabled>false</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </repository> <repository> <id>releases-repo</id> <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>false</enabled></snapshots> </repository> </repositories> </profile> <profile> <id>sonar</id> <properties> <sonar.sources>.</sonar.sources> <sonar.host.url>https://sonarcloud.io</sonar.host.url> </properties> <activation> <activeByDefault>false</activeByDefault> </activation> </profile> </profiles> </settings>" > $GITHUB_WORKSPACE/settings.xml
- name: Build Automationtests with Maven
run: |
cd ${{ env.SERVICE_LOCATION}}
mvn clean package -s $GITHUB_WORKSPACE/settings.xml
- name: Copy configuration files to target directory.
run: |
cp -r ${{ env.SERVICE_LOCATION}}/target/classes/config ${{ env.SERVICE_LOCATION}}/target/config
cp -r ${{ env.SERVICE_LOCATION}}/testNgXmlFiles ${{ env.SERVICE_LOCATION}}/target/testNgXmlFiles
- name: Ready the springboot artifacts
if: ${{ !contains(github.ref, 'master') || !contains(github.ref, 'main') }}
run: |
## FIND JARS & COPY ONLY EXECUTABLE JARs STORED UNDER TARGET DIRECTORY
find ${{ env.SERVICE_LOCATION }} -path '*/target/*' -exec zip ${{ env.BUILD_ARTIFACT }}.zip {} +
- name: Upload the springboot jars
if: ${{ !contains(github.ref, 'master') || !contains(github.ref, 'main') }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.BUILD_ARTIFACT }}
path: ${{ env.BUILD_ARTIFACT }}.zip
- uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,message,author,commit,workflow,job # selectable (default: repo,message)
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required
if: failure() # Pick up events even if the job fails or is canceled.

build-dockers_apitest_pms:
needs: build-apitest-pms-local
strategy:
matrix:
include:
- SERVICE_LOCATION: 'api-test'
SERVICE_NAME: 'apitest-pms'
BUILD_ARTIFACT: 'apitest-pms-local'
ONLY_DOCKER: true
fail-fast: false
name: ${{ matrix.SERVICE_NAME }}
uses: mosip/kattu/.github/workflows/docker-build.yml@master-java21
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 }}

sonar_analysis_apitest_pms:
needs: build-maven-apitest-pms
if: "${{ github.event_name != 'pull_request' }}"
uses: mosip/kattu/.github/workflows/maven-sonar-analysis.yml@master-java21
with:
SERVICE_LOCATION: ./api-test
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
ORG_KEY: ${{ secrets.ORG_KEY }}
OSSRH_USER: ${{ secrets.OSSRH_USER }}
OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
GPG_SECRET: ${{ secrets.GPG_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
29 changes: 29 additions & 0 deletions .github/workflows/release-changes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release/pre-release Preparation.

on:
workflow_dispatch:
inputs:
MESSAGE:
description: 'Triggered for release or pe-release'
required: false
default: 'Release Preparation'
RELEASE_TAG:
description: 'tag to update'
required: true
SNAPSHOT_TAG:
description: 'tag to be replaced'
required: true
BASE:
description: 'base branch for PR'
required: true
jobs:
maven-release-preparation:
uses: mosip/kattu/.github/workflows/release-changes.yml@master
with:
MESSAGE: ${{ inputs.MESSAGE }}
RELEASE_TAG: ${{ inputs.RELEASE_TAG }}
SNAPSHOT_TAG: ${{ inputs.SNAPSHOT_TAG }}
BASE: ${{ inputs.BASE }}
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
ACTION_PAT: ${{ secrets.ACTION_PAT }}
35 changes: 35 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Tagging of repos

on:
workflow_dispatch:
inputs:
TAG:
description: 'Tag to be published'
required: true
type: string
BODY:
description: 'Release body message'
required: true
default: 'Changes in this Release'
type: string
PRE_RELEASE:
description: 'Pre-release? True/False'
required: true
default: False
type: string
DRAFT:
description: 'Draft? True/False'
required: false
default: False
type: string

jobs:
tag-branch:
uses: mosip/kattu/.github/workflows/tag.yml@master
with:
TAG: ${{ inputs.TAG }}
BODY: ${{ inputs.BODY }}
PRE_RELEASE: ${{ inputs.PRE_RELEASE }}
DRAFT: ${{ inputs.DRAFT }}
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
65 changes: 58 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,84 @@
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?branch=develop&project=mosip_partner-management-services&metric=alert_status)](https://sonarcloud.io/dashboard?branch=develop&id=mosip_partner-management-services)

## Overview
This repository contains the source code MOSIP Partner Management module. For an overview refer [here](https://docs.mosip.io/1.2.0/modules/partner-management-services). The module exposes API endpoints. For a reference front-end UI implementation refer to [Partner-management UI github repo](https://github.com/mosip/partner-management-portal/)
This repository contains the source code MOSIP Partner Management module. For an overview refer [here](https://docs.mosip.io/1.2.0/modules/partner-management-services). The module exposes API endpoints. For a reference front-end UI implementation refer to [Partner-management UI GitHub repo](https://github.com/mosip/partner-management-portal)

Partnermanagement module contains following services:
Partner management module contains following services:
1. Partner management service
2. Policy management service

## Databases
Refer to [SQL scripts](db_scripts).

## Build & run (for developers)
The project requires JDK 1.11.
The project requires JDK 21.0.3
and mvn version - 3.9.6

1. Build and install:
```
$ cd kernel
$ cd partner
$ mvn install -DskipTests=true -Dmaven.javadoc.skip=true -Dgpg.skip=true
```
### Remove the version-specific suffix (PostgreSQL95Dialect) from the Hibernate dialect configuration
```
mosip.datasource.authdevice.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
mosip.datasource.regdevice.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
```
### For Spring-boot 3.x we need to specify the ANT Path Matcher for using the existing ANT path patterns.
spring.mvc.pathmatch.matching-strategy=ANT_PATH_MATCHER
### Spring boot 3.x onwards we need to specify the below property to unmask values in actuator env url
management.endpoint.env.show-values=ALWAYS
1. Build Docker for a service:
```
$ cd <service folder>
$ docker build -f Dockerfile
```
## Deploy
To deploy PMS on Kubernetes cluster using Dockers refer to [Sandbox Deployment](https://docs.mosip.io/1.2.0/deployment/sandbox-deployment).
### Configuration
[partner-management-default.properties](https://github.com/mosip/mosip-config/blob/master/partner-management-default.properties)
[application-default.properties](https://github.com/mosip/mosip-config/blob/master/application-default.properties)
defined here.
### Add auth-adapter in a class-path to run a services
```
<dependency>
<groupId>io.mosip.kernel</groupId>
<artifactId>kernel-auth-adapter</artifactId>
<version>${kernel.auth.adapter.version}</version>
</dependency>
```
## Deployment in K8 cluster with other MOSIP services:
### Pre-requisites
* Set KUBECONFIG variable to point to existing K8 cluster kubeconfig file:
```
export KUBECONFIG=~/.kube/<k8s-cluster.config>
```
### Install
```
$ cd deploy
$ ./install.sh
```
### Delete
```
$ cd deploy
$ ./delete.sh
```
### Restart
```
$ cd deploy
$ ./restart.sh
```
## Test
Automated functional tests available in [Functional Tests repo](https://github.com/mosip/mosip-functional-tests).
Automated functional tests available in [Functional Tests](api-test).
## APIs
API documentation is available [here](https://mosip.github.io/documentation/).
Expand Down
Loading

0 comments on commit c296e02

Please sign in to comment.