Skip to content

Commit

Permalink
Merge branch 'mosip:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
MadhuMosip authored Aug 27, 2024
2 parents e39a2b2 + 8a9dc65 commit f7ec49c
Show file tree
Hide file tree
Showing 22 changed files with 909 additions and 2 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 }}
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,25 @@ Following are the artifacts which is being served by the service:
7. clamav-antivirus.jar

All these artifacts are released as a part of the Mosip Release with some of them being taken from open sourced repository as per the need.

## Deployment in K8 cluster with other MOSIP services:
### Pre-requisites
* Set KUBECONFIG variable to point to existing K8 cluster kubeconfig file:
* ```
export KUBECONFIG=~/.kube/<my-cluster.config>
```
### Install
```
$ cd deploy
$ ./install.sh
```
### Delete
```
$ cd deploy
$ ./delete.sh
```
### Restart
```
$ cd deploy
$ ./restart.sh
```
7 changes: 6 additions & 1 deletion artifacts/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ ENV idp_auth_wrapper_lib_zip_path=${base_path}/libs-release-local/idp/idp-auth-w
# environment variable for esignet wrappers zip path
ENV esignet_wrapper_lib_zip_path=${base_path}/libs-release-local/esignet

#environment variable for certify plugins zip path
ENV certify_plugin_zip_path=${base_path}/libs-release-local/certify

# environment variable for Clamav dependency
ENV clamav_path=${base_path}/libs-release-local/clamav

Expand All @@ -126,7 +129,7 @@ ENV version=1.2.1-SNAPSHOT
ENV idp_auth_wrapper_version=0.0.1-SNAPSHOT

# Create all the jar, i18n & theme paths.
RUN mkdir -p ${biosdk_client_zip_path}/biosdk-client ${demosdk_zip_path}/demosdk ${biosdk_lib_zip_path}/biosdk-lib ${cache_path} ${ida_sh_path} ${hsm_client_path} ${mosip_plugins_zip_path} ${kernel_jar_path} ${test_jar_path} ${idobject_jar_path} ${regproc_jar_path} ${sdk_path} ${image_compressor_path}/image-compressor ${icu4j_jar_path} ${clamav_path} ${i18n_zip_path} ${theme_zip_path} ${child_auth_filter_jar_path} ${base_path}/libs-release-local/reg-client ${scripts_path} ${master_template_path} ${jpeg_sdk_path} ${jpegsdk_lib_zip_path}/jpeg-sdk-lib/ ${idp_auth_wrapper_lib_zip_path} ${esignet_wrapper_lib_zip_path}/esignet-wrapper
RUN mkdir -p ${biosdk_client_zip_path}/biosdk-client ${demosdk_zip_path}/demosdk ${biosdk_lib_zip_path}/biosdk-lib ${cache_path} ${ida_sh_path} ${hsm_client_path} ${mosip_plugins_zip_path} ${kernel_jar_path} ${test_jar_path} ${idobject_jar_path} ${regproc_jar_path} ${sdk_path} ${image_compressor_path}/image-compressor ${icu4j_jar_path} ${clamav_path} ${i18n_zip_path} ${theme_zip_path} ${child_auth_filter_jar_path} ${base_path}/libs-release-local/reg-client ${scripts_path} ${master_template_path} ${jpeg_sdk_path} ${jpegsdk_lib_zip_path}/jpeg-sdk-lib/ ${idp_auth_wrapper_lib_zip_path} ${esignet_wrapper_lib_zip_path}/esignet-wrapper ${certify_plugin_zip_path}/certify-plugin

# Copy all the respective jars to the location

Expand All @@ -138,6 +141,8 @@ COPY /src/deployment/docker/id-authentication/* ${ida_sh_path}/

COPY /src/hsm/client.zip ${hsm_client_path}/

COPY /src/hsm/client-21.zip ${hsm_client_path}/

COPY /src/mosip-plugins/sign-in-with-esignet/sign-in-with-esignet.zip ${mosip_plugins_zip_path}/

COPY /src/testing/regproc-reprocessor-ceylon-cache-repo.zip ${test_jar_path}/
Expand Down
5 changes: 5 additions & 0 deletions artifacts/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ zip -r -j ${esignet_wrapper_lib_zip_path}/esignet-wrapper.zip ${esignet_wrapper_
rm -rf ${esignet_wrapper_lib_zip_path}/esignet-wrapper
echo esignet-wrapper zip creation completed

echo certify-plugin zip creation started
zip -r -j ${certify_plugin_zip_path}/certify-plugin.zip ${certify_plugin_zip_path}/certify-plugin/*
rm -rf ${certify_plugin_zip_path}/certify-plugin
echo certify-plugin zip creation completed

echo Creating resources.zip file for all the resources provided
zip -r -j ${base_path}/libs-release-local/reg-client/resources.zip ${work_dir}/resources
rm -rf ${work_dir}/resources
Expand Down
41 changes: 40 additions & 1 deletion artifacts/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,19 @@
<esignet-digital-credential-wrapper.fileName>sunbird-rc-esignet-integration-impl.jar</esignet-digital-credential-wrapper.fileName>
<!-- latest mock-sdk -->
<mock-sdk-latest.version>1.2.0.1-B4</mock-sdk-latest.version>

<!-- certify sunbird plugin -->
<certify-plugin.location>/usr/share/nginx/html/artifactory/libs-release-local/certify/certify-plugin</certify-plugin.location>
<certify-sunbird-plugin.version>0.2.0</certify-sunbird-plugin.version>
<certify-sunbird-plugin.fileName>certify-sunbird-plugin.jar</certify-sunbird-plugin.fileName>
<!-- certify mosip identity plugin -->
<certify-plugin.location>/usr/share/nginx/html/artifactory/libs-release-local/certify/certify-plugin</certify-plugin.location>
<certify-mosip-identity-plugin.version>0.2.0</certify-mosip-identity-plugin.version>
<certify-mosip-identity-plugin.fileName>certify-mosip-identity-plugin.jar</certify-mosip-identity-plugin.fileName>
<!-- certify mock plugin -->
<certify-plugin.location>/usr/share/nginx/html/artifactory/libs-release-local/certify/certify-plugin</certify-plugin.location>
<certify-mock-plugin.version>0.2.0</certify-mock-plugin.version>
<certify-mock-plugin.fileName>certify-mock-identity-plugin.jar</certify-mock-plugin.fileName>
</properties>

<build>
Expand Down Expand Up @@ -337,7 +350,33 @@
<destFileName>${esignet-digital-credential-wrapper.fileName}</destFileName>
<type>jar</type>
</artifactItem>

<!-- artifactItem section for certify sunbird plugin -->
<artifactItem>
<groupId>io.mosip.certify.sunbirdrc</groupId>
<artifactId>sunbird-rc-certify-integration-impl</artifactId>
<version>${certify-sunbird-plugin.version}</version>
<outputDirectory>${certify-plugin.location}</outputDirectory>
<destFileName>${certify-sunbird-plugin.fileName}</destFileName>
<type>jar</type>
</artifactItem>
<!-- artifactItem section for certify mosip identity plugin -->
<artifactItem>
<groupId>io.mosip.certify</groupId>
<artifactId>mosip-identity-certify-plugin</artifactId>
<version>${certify-mosip-identity-plugin.version}</version>
<outputDirectory>${certify-plugin.location}</outputDirectory>
<destFileName>${certify-mosip-identity-plugin.fileName}</destFileName>
<type>jar</type>
</artifactItem>
<!-- artifactItem section for certify mock identity plugin -->
<artifactItem>
<groupId>io.mosip.certify</groupId>
<artifactId>mock-certify-plugin</artifactId>
<version>${certify-mock-plugin.version}</version>
<outputDirectory>${certify-plugin.location}</outputDirectory>
<destFileName>${certify-mock-plugin.fileName}</destFileName>
<type>jar</type>
</artifactItem>
</artifactItems>
<overWriteReleases>true</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
Expand Down
Binary file added artifacts/src/hsm/client-21.zip
Binary file not shown.
6 changes: 6 additions & 0 deletions deploy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Artifactory

## Install
```sh
./install.sh
```
30 changes: 30 additions & 0 deletions deploy/delete.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
# Uninstalls artifactory
# Usage: ./delete.sh [kubeconfig]

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

function deleting_artifactory() {
NS=artifactory
while true; do
read -p "Are you sure you want to delete artifactory helm chart?(Y/n) " yn
if [ $yn = "Y" ]
then
helm -n $NS delete artifactory
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_artifactory # calling function
35 changes: 35 additions & 0 deletions deploy/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash
# Installs artifactory
## Usage: ./install.sh [kubeconfig]

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

NS=artifactory
CHART_VERSION=0.9.0-INJI

echo Create $NS namespace
kubectl create ns $NS

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

echo Installing artifactory
helm -n $NS install artifactory mosip/artifactory --version $CHART_VERSION

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

echo Installed artifactory service
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_artifactory # calling function
25 changes: 25 additions & 0 deletions deploy/restart.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
# Restart the artifactory service
## Usage: ./restart.sh [kubeconfig]

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

function Restarting_artifactory() {
NS=artifactory
kubectl -n $NS rollout restart deploy

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

echo Restarted artifactory 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_artifactory # calling function
1 change: 1 addition & 0 deletions helm/artifactory/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
charts/
21 changes: 21 additions & 0 deletions helm/artifactory/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
20 changes: 20 additions & 0 deletions helm/artifactory/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: v2
name: artifactory
description: A Helm chart for MOSIP Artifactory
type: application
version: 0.9.0-INJI
appVersion: ""
dependencies:
- name: common
repository: https://charts.bitnami.com/bitnami
tags:
- bitnami-common
version: 1.x.x
home: https://mosip.io
keywords:
- artifactory
- antivirus
- anti-virus
maintainers:
- email: [email protected]
name: MOSIP
21 changes: 21 additions & 0 deletions helm/artifactory/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Artifactory

Helm chart for installing Artifactory

## TL;DR

```console
$ helm repo add mosip https://mosip.github.io
$ helm install my-release mosip/artifactory
```

## Introduction

%%INTRODUCTION%% (check existing examples)

## Prerequisites

- Kubernetes 1.12+
- Helm 3.1.0
- PV provisioner support in the underlying infrastructure
- ReadWriteMany volumes for deployment scaling
1 change: 1 addition & 0 deletions helm/artifactory/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Loading

0 comments on commit f7ec49c

Please sign in to comment.