Skip to content

Commit

Permalink
Change in options, Added separate step for install Prerequisites.
Browse files Browse the repository at this point in the history
  • Loading branch information
sushantpatil1214 committed Jul 18, 2024
1 parent 96cba82 commit 01087f0
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 44 deletions.
16 changes: 8 additions & 8 deletions README-Install.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ This Bash script is designed for deploying JeMPI locally with various options. I
3. **Select an Option:**
- **Option 1:** Deploy JeMPI from Scratch (With all installations).
- **Option 2:** Deploy JeMPI without installations.
- **Option 3:** Build and Reboot.
- **Option 4:** Restart JeMPI.
- **Option 5:** Down JeMPI.
- **Option 6:** Backup Postgres & Dgraph.
- **Option 7:** Restore Postgres & Dgraph.
- **Option 8:** Destroy JeMPI (This process will wipe all data).
- **Option 1:** Deploy JeMPI (For Fresh Start).
- **Option 2:** Build and Reboot.
- **Option 3:** Restart JeMPI.
- **Option 4:** Down JeMPI.
- **Option 5:** Backup Postgres & Dgraph.
- **Option 6:** Restore Postgres & Dgraph.
- **Option 7:** Destroy JeMPI (This process will wipe all data).
- **Option 6:** Install Prerequisites..
Expand Down
58 changes: 22 additions & 36 deletions devops/linux/docker/deployment/deploy-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,18 @@ export JEMPI_HOME="$(pwd)"
echo "$JEMPI_HOME"
export JAVA_VERSION=21.0.3-tem
echo "Setting JEMPI_HOME to: $JEMPI_HOME"
JEMPI_CONFIGURATION_PATH=$JEMPI_HOME/JeMPI_Apps/JeMPI_Configuration/reference/config-reference.json
JEMPI_ENV_CONFIGURATION=create-env-linux-low-1.sh

# Display menu options
echo "Select an option for local deployment:"
echo "1. Deploy JeMPI from Scratch (With all installations...)."
echo "2. Deploy JeMPI without installations"
echo "3. Build and Reboot."
echo "4. Restart JeMPI."
echo "5. Down the JeMPI."
echo "6. Backup Postgres & Dgraph."
echo "7. Restore Postgres & Dgraph."
echo "8. Destroy JeMPI (This process will wipe all data)."

echo "1. Deploy JeMPI (For Fresh Start)."
echo "2. Build and Reboot."
echo "3. Restart JeMPI."
echo "4. Stop JeMPI."
echo "5. Backup Postgres & Dgraph."
echo "6. Restore Postgres & Dgraph."
echo "7. Destroy JeMPI (This process will wipe all data and Volumes)."
echo "8. Install Prerequisites."

# Prompt user for choice
read -p "Enter your choice (1-8): " choice
Expand Down Expand Up @@ -95,13 +93,6 @@ run_enviroment_configuration_and_helper_script(){
popd
}

run_field_configuration_file() {
# Running Docker helper scripts
echo "Running JeMPI configuration with path: $JEMPI_CONFIGURATION_PATH"
pushd "$JEMPI_HOME/JeMPI_Apps/JeMPI_Configuration/"
source create.sh $JEMPI_CONFIGURATION_PATH
popd
}

initialize_swarm(){
if docker info | grep -q "Swarm: active"; then
Expand Down Expand Up @@ -157,48 +148,38 @@ restore_db(){
popd
else
echo "Database restore cancelled. Moving ahead without restore."
cd de # Continue with the rest of your script
# Continue with the rest of your script
fi
}

# Process user choice
case $choice in
1)
echo "Deploy JeMPI from Scratch"
install_docker
install_sdkman_and_java_sbt_maven
echo "Deploy JeMPI With Fresh Start"
hostname_setup
run_enviroment_configuration_and_helper_script
initialize_swarm
pull_docker_images_and_push_local
initialize_db_build_all_stack_and_reboot
;;
2)
echo "Deploy JeMPI"
hostname_setup
run_enviroment_configuration_and_helper_script
initialize_swarm
pull_docker_images_and_push_local
initialize_db_build_all_stack_and_reboot
;;
3)
echo "Build and Reboot"
build_all_stack_and_reboot
;;
4)
3)
echo "Restart JeMPI"
pushd "$JEMPI_HOME/devops/linux/docker/deployment/reboot"
source d-stack-3-reboot.sh
popd
;;
5)
echo "Down JeMPI"
4)
echo "Stop JeMPI"
pushd "$JEMPI_HOME/devops/linux/docker/deployment/down"
source d-stack-3-down.sh
popd
exit 0
;;
6)
5)
BACKUP_DATE_TIME=$(date +%Y-%m-%d_%H%M%S)
echo "Started Backup at- $BACKUP_DATE_TIME"
pushd "$JEMPI_HOME/devops/linux/docker/backup_restore" || exit
Expand All @@ -207,11 +188,11 @@ case $choice in
popd || exit

;;
7)
6)
echo "Restore Databases"
restore_db
;;
8)
7)
echo "Destroy"
# Main script
echo "Do you want to continue? (Ctrl+Y for Yes, any other key for No)"
Expand All @@ -227,7 +208,12 @@ case $choice in
fi
exit 0
;;
8)
echo "Deploy JeMPI from Scratch"
install_docker
install_sdkman_and_java_sbt_maven
;;
*)
echo "Invalid choice. Please enter a number."
;;
esac
esac

0 comments on commit 01087f0

Please sign in to comment.