Skip to content

Commit

Permalink
[MOSIP-35421] Moved installtion scripts of ida apitestrig.
Browse files Browse the repository at this point in the history
Signed-off-by: Mohanraj209 <[email protected]>
  • Loading branch information
Mohanraj209 committed Oct 7, 2024
1 parent 7f079e2 commit 3a93b87
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 1 deletion.
20 changes: 19 additions & 1 deletion deploy/ida-apitestrig/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
# IDA APITESTRIG

This directory contains `values.yaml` file which contains the latest ida apitestrig release changes with latest released Docker image and tag.
# INSTALL

This `install.sh` script automates the process of cloning `mosip-functional-tests` repository from a user-defined specific branch from a Git repository, running an installation script to deploy ida apitestrig within the cluster, and cleaning up the repository afterward.

Note: This directory contains `values.yaml` file which contains the latest ida apitestrig release changes with latest released Docker image and tag. The above install script uses this `values.yaml` by default to deploy apitestrig with latest changes.

## Prerequisites

- Ensure you have **git** installed on your machine.
- You need access to the Kubernetes cluster configuration file (`kubeconfig`).
- Ensure you have the necessary permissions to execute shell scripts.

## Script Usage

1. **Clone this script to your local machine**.
2. **Run the script using the following command**:
```bash
./script.sh <path-to-kubeconfig>
```

## TL;DR

Expand Down
52 changes: 52 additions & 0 deletions deploy/ida-apitestrig/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/bash

# Prompt the user for the branch name
read -p "Enter the Git branch (default is 'develop'): " GIT_BRANCH
GIT_BRANCH=${GIT_BRANCH:-develop} # Default to 'develop' if no input is provided

echo "set kubeconfig"
export KUBECONFIG=$1

# Set variables
REPO_URL="https://github.com/mosip/mosip-functional-tests.git"
INSTALL_SCRIPT="install.sh"
VALUES_FILE="../../../values.yaml" # Path to your custom values.yaml file

# Clone the repository
echo "Cloning repository from $REPO_URL on branch $GIT_BRANCH..."
if git clone -b "$GIT_BRANCH" "$REPO_URL" ; then
echo "Repository cloned successfully."
else
echo "Failed to clone repository."
exit 1
fi

# Navigate to the deployment directory
echo "Navigating to deploy directory..."
git_repo_name="$(basename "$REPO_URL" .git)"

cd $git_repo_name

git sparse-checkout init --cone && git sparse-checkout set deploy/apitestrig

find . -type f ! -path "./deploy/*" -exec rm -f {} \;

cd deploy/apitestrig || { echo "apitestrig directory not found."; exit 1; }
cp $VALUES_FILE values.yaml

# Check if the install script exists and is executable
if [ -x "$INSTALL_SCRIPT" ]; then
echo "Running install script with values file $VALUES_FILE..."
source ./"$INSTALL_SCRIPT"
echo "Install script executed successfully."
else
echo "Install script not found or not executable."
exit 1
fi

# Cleanup cloned repository
echo "Cleaning up..."
cd ../../..
rm -rf $git_repo_name

echo "Deployment complete!"
48 changes: 48 additions & 0 deletions deploy/ida-apitestrig/values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,55 @@
modules:
masterdata:
enabled: false
image:
repository: mosipqa/apitest-masterdata
tag: develop
pullPolicy: Always
prereg:
enabled: false
image:
repository: mosipqa/apitest-prereg
tag: develop
pullPolicy: Always
idrepo:
enabled: false
image:
repository: mosipqa/apitest-idrepo
tag: develop
pullPolicy: Always
partner:
enabled: false
image:
repository: mosipqa/apitest-partner
tag: develop
pullPolicy: Always
resident:
enabled: false
image:
repository: mosipqa/apitest-resident
tag: develop
pullPolicy: Always
auth:
enabled: true
image:
repository: mosipqa/apitest-auth
tag: develop
pullPolicy: Always
esignet:
enabled: false
image:
repository: mosipqa/apitest-esignet
tag: develop
pullPolicy: Always
mimoto:
enabled: false
image:
repository: mosipqa/apitest-mimoto
tag: develop
pullPolicy: Always
pms:
enabled: false
image:
repository: mosipqa/apitest-pms
tag: develop
pullPolicy: Always

0 comments on commit 3a93b87

Please sign in to comment.