Skip to content

Commit

Permalink
ES-2130 ES-2142 ES-2143 MOSIP-38703 MOSIP-38705 Cherry-picked release…
Browse files Browse the repository at this point in the history
… script changes from develop to release-1.1.x (#536)

* ES-2130 ES-2142 ES-2143 (#511)

* ES-2130 ES-2142 ES-2143

Signed-off-by: ase-101 <[email protected]>

* ES-2130 ES-2142 ES-2143

Signed-off-by: ase-101 <[email protected]>

* ES-2130 ES-2142 ES-2143

Signed-off-by: ase-101 <[email protected]>

* ES-2130 ES-2142 ES-2143

Signed-off-by: ase-101 <[email protected]>

* ES-2130 ES-2142 ES-2143

Signed-off-by: ase-101 <[email protected]>

---------

Signed-off-by: ase-101 <[email protected]>

* [MOSIP-38703],[MOSIP-38704] & [MOSIP-38707] updated push-trigger.yml  and added new manual-docker-build.yml files Continue docker build only if the SNAPSHOT is present in parent pom otherwise skip

Signed-off-by: techno-467 <[email protected]>

* [MOSIP-38703],[MOSIP-38704] & [MOSIP-38707] updated push-trigger.yml  and added new manual-docker-build.yml files Continue docker build only if the SNAPSHOT is present in parent pom otherwise skip

Signed-off-by: techno-467 <[email protected]>

* [MOSIP-38705] & [38705] added installation script for esignet-with-plugins and for esignet.

Signed-off-by: techno-467 <[email protected]>

* Updated pom version

Signed-off-by: ase-101 <[email protected]>

* [MOSIP-38705] & [MOSIP-38705] added installation script for esignet-with-plugins and for esignet-signup.

Signed-off-by: techno-467 <[email protected]>

* Updated version

Signed-off-by: ase-101 <[email protected]>

* Updated version

Signed-off-by: ase-101 <[email protected]>

---------

Signed-off-by: ase-101 <[email protected]>
Signed-off-by: techno-467 <[email protected]>
Co-authored-by: Prafulrakhade <[email protected]>
Co-authored-by: techno-467 <[email protected]>
Co-authored-by: Praful Rakhade <[email protected]>
  • Loading branch information
4 people authored Jan 20, 2025
1 parent dc0ca12 commit 6f9852f
Show file tree
Hide file tree
Showing 24 changed files with 629 additions and 107 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/manual-docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Manual Docker Build for without -SNAPSHOT

on:
workflow_dispatch:
inputs:
message:
description: 'Message for manually triggering'
required: false
default: 'Triggered for Updates'
type: string

jobs:
build_maven_signup_with_plugins:
uses: mosip/kattu/.github/workflows/maven-build.yml@master
with:
SERVICE_LOCATION: ./signup-with-plugins
BUILD_ARTIFACT: signup-with-plugins
MAVEN_NON_EXEC_ARTIFACTS: "esignet-mock-plugin.jar,mosip-identity-plugin.jar"
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 }}

build_dockers_esignet_with_plugins:
needs: [ build_maven_signup_with_plugins, check_snapshot_version, publish_to_nexus ]
if: ${{ needs.check_snapshot_version.outputs.is_condition == 'true' }}
strategy:
matrix:
include:
- SERVICE_LOCATION: 'signup-with-plugins'
SERVICE_NAME: 'signup-with-plugins'
BUILD_ARTIFACT: 'signup-with-plugins'
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 }}
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 }}
118 changes: 106 additions & 12 deletions .github/workflows/push-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ on:
- ES-*

jobs:
build-maven-esignet-signup:
build_maven_esignet_signup:
uses: mosip/kattu/.github/workflows/maven-build.yml@master
with:
SERVICE_LOCATION: ./
Expand All @@ -36,10 +36,69 @@ jobs:
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
GPG_SECRET: ${{ secrets.GPG_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

check_snapshot_version:
runs-on: ubuntu-latest
outputs:
is_condition: ${{ steps.check_output.outputs.is_condition }}
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Check for -SNAPSHOT version in pom.xml files
id: check_output
shell: bash
run: |
# Initialize the flag that will hold the result
condition_met=false
echo "Initial condition_met: $condition_met"
# Loop through each pom.xml file and check if -SNAPSHOT version is present in the parent block
for pom_file in $(find . -name "pom.xml"); do
echo "Processing $pom_file"
# Extract the <parent> block from the pom.xml
parent_block=$(awk '/<parent>/,/<\/parent>/' "$pom_file")
# If there's no <parent> block, skip this file and move to the next one
if [ -z "$parent_block" ]; then
echo "No <parent> block found in $pom_file, skipping this file."
continue
fi
# Debug: Print the entire parent block for verification
echo "Checking the following parent block in $pom_file:"
echo "$parent_block"
# Extract the <version> field from the <parent> block
version_in_parent=$(echo "$parent_block" | grep -oP '<version>\K.*(?=</version>)')
# Debug the extracted version
echo "Extracted version in $pom_file: $version_in_parent"
# Check if the version contains '-SNAPSHOT'
if [[ "$version_in_parent" == *"-SNAPSHOT"* ]]; then
echo "Found '-SNAPSHOT' version in $pom_file."
condition_met=true
break # Stop checking further files once we find '-SNAPSHOT'
else
echo "No '-SNAPSHOT' version found in $pom_file."
fi
done
# Debug the final condition_met value
echo "Final condition_met value: $condition_met"
# Set the output for the next step
echo "::set-output name=is_condition::$condition_met"
- name: Debug Condition Output
run: |
echo "Condition Met: ${{ steps.check_output.outputs.is_condition }}"
publish_to_nexus:
if: "${{ !contains(github.ref, 'master') && github.event_name != 'pull_request' }}"
needs: build-maven-esignet-signup
needs: build_maven_esignet_signup
uses: mosip/kattu/.github/workflows/maven-publish-to-nexus.yml@master
with:
SERVICE_LOCATION: ./
Expand All @@ -53,7 +112,7 @@ jobs:


sonar_analysis:
needs: build-maven-esignet-signup
needs: build_maven_esignet_signup
if: "${{ github.event_name != 'pull_request' }}"
uses: mosip/kattu/.github/workflows/maven-sonar-analysis.yml@master
with:
Expand All @@ -67,8 +126,8 @@ jobs:
GPG_SECRET: ${{ secrets.GPG_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

build-dockers:
needs: build-maven-esignet-signup
build_dockers:
needs: build_maven_esignet_signup
strategy:
matrix:
include:
Expand All @@ -87,8 +146,43 @@ jobs:
ACTOR_DOCKER_HUB: ${{ secrets.ACTOR_DOCKER_HUB }}
RELEASE_DOCKER_HUB: ${{ secrets.RELEASE_DOCKER_HUB }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

build_maven_signup_with_plugins:
uses: mosip/kattu/.github/workflows/maven-build.yml@master
with:
SERVICE_LOCATION: ./signup-with-plugins
BUILD_ARTIFACT: signup-with-plugins
MAVEN_NON_EXEC_ARTIFACTS: "esignet-mock-plugin.jar,mosip-identity-plugin.jar"
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 }}

build_dockers_esignet_with_plugins:
needs: [ build_maven_signup_with_plugins, check_snapshot_version, publish_to_nexus ]
if: ${{ needs.check_snapshot_version.outputs.is_condition == 'true' }}
strategy:
matrix:
include:
- SERVICE_LOCATION: 'signup-with-plugins'
SERVICE_NAME: 'signup-with-plugins'
BUILD_ARTIFACT: 'signup-with-plugins'
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 }}
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 }}

build-dockers-signup-ui:
build_dockers_signup_ui:
strategy:
matrix:
include:
Expand All @@ -106,7 +200,7 @@ jobs:
RELEASE_DOCKER_HUB: ${{ secrets.RELEASE_DOCKER_HUB }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

build-maven-apitest-esignet-signup:
build_maven_apitest_esignet_signup:
uses: mosip/kattu/.github/workflows/maven-build.yml@master-java21
with:
SERVICE_LOCATION: ./api-test
Expand All @@ -120,7 +214,7 @@ jobs:

publish_to_nexus_apitest-esignet-signup:
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-esignet-signup
needs: build_maven_apitest_esignet_signup
uses: mosip/kattu/.github/workflows/maven-publish-to-nexus.yml@master-java21
with:
SERVICE_LOCATION: ./api-test
Expand All @@ -133,7 +227,7 @@ jobs:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

build-apitest-esignet-signup-local:
needs: build-maven-apitest-esignet-signup
needs: build_maven_apitest_esignet_signup
runs-on: ubuntu-latest
env:
NAMESPACE: ${{ secrets.dev_namespace_docker_hub }}
Expand Down Expand Up @@ -166,7 +260,7 @@ jobs:
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
uses: actions/upload-artifact@v4
with:
name: ${{ env.BUILD_ARTIFACT }}
path: ${{ env.BUILD_ARTIFACT }}.zip
Expand Down Expand Up @@ -201,8 +295,8 @@ jobs:
RELEASE_DOCKER_HUB: ${{ secrets.RELEASE_DOCKER_HUB }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

sonar_analysis_apitest-esignet-signup:
needs: build-maven-apitest-esignet-signup
sonar_analysis_apitest_esignet_signup:
needs: build_maven_apitest_esignet_signup
if: "${{ github.event_name != 'pull_request' }}"
uses: mosip/kattu/.github/workflows/maven-sonar-analysis.yml@master-java21
with:
Expand Down
2 changes: 1 addition & 1 deletion deploy/install-signup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function installing_signup() {

helm repo add mosip https://mosip.github.io/mosip-helm
# List of modules to install
declare -a modules=("signup-service" "signup-ui")
declare -a modules=("signup-with-plugins" "signup-ui")

echo "Installing signup services"

Expand Down
2 changes: 1 addition & 1 deletion deploy/restart-signup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fi
function Restarting_All() {
ROOT_DIR=`pwd`

declare -a module=("signup-service" "signup-ui")
declare -a module=("signup-with-plugins" "signup-ui")

echo restarting signup services

Expand Down
35 changes: 6 additions & 29 deletions deploy/signup-service/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,39 +69,16 @@ function installing_signup() {
ENABLE_INSECURE='--set enable_insecure=true';
fi

while true; do
read -p "Do you want to use the default plugins? (y/n): " ans
if [[ "$ans" == "y" || "$ans" == "Y" ]]; then
echo "Default plugins are listed below, please provide the correct plugin number."
echo "1. esignet-mock-plugin.jar"
echo "2. mosip-identity-plugin.jar"
read -p "Enter the plugin number: " plugin_no
while true; do
if [[ "$plugin_no" == "1" ]]; then
plugin_option="--set plugin_name_env=esignet-mock-plugin.jar"
break
elif [[ "$plugin_no" == "2" ]]; then
plugin_option="--set plugin_name_env=mosip-identity-plugin.jar"
break
else
echo "please provide the correct plugin number (1 or 2)."
fi
done
break
elif [[ "$ans" == "n" || "$ans" == "N" ]]; then
read -p "Provide the URL to download the plugins zip " plugin_url
read -p "Provide the plugin jar name (with extension eg., test-plugin.jar) " plugin_jar
plugin_option="--set pluginNameEnv=$plugin_jar --set pluginUrlEnv=$plugin_url"
break
else
echo " Invalid response. Please respond with y (yes) or n (no)."
fi
done
read -p "Provide the URL to download the plugins zip " plugin_url
read -p "Provide the plugin jar name (with extension eg., test-plugin.jar) " plugin_jar
plugin_option="--set pluginNameEnv=$plugin_jar --set pluginUrlEnv=$plugin_url"


echo Installing signup
helm -n $NS install signup mosip/signup \
-f values.yaml --version $CHART_VERSION $ENABLE_INSECURE $plugin_option \
-f values.yaml --version $CHART_VERSION \
--set image.repository=mosipdev/signup --set image.tag=release-1.1.x \
$ENABLE_INSECURE $plugin_option \
--set metrics.serviceMonitor.enabled=$servicemonitorflag --wait

kubectl -n $NS get deploy -o name | xargs -n1 -t kubectl -n $NS rollout status
Expand Down
31 changes: 31 additions & 0 deletions deploy/signup-with-plugins/delete.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
# Deletes signup-with-plugins helm chart
## Usage: ./delete.sh [kubeconfig]

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

function Deleting_signup_with_plugins() {
NS=signup
while true; do
read -p "Are you sure you want to delete signup helm charts?(Y/n) " yn
if [[ $yn = "Y" ]] || [[ $yn = "y" ]];
then
helm -n $NS delete signup
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_signup_with_plugins # calling function

Loading

0 comments on commit 6f9852f

Please sign in to comment.