Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automation Script with different set of scripts #170

Merged
merged 5 commits into from
Jan 26, 2024
Merged

Conversation

sushantpatil1214
Copy link
Collaborator

@sushantpatil1214 sushantpatil1214 commented Jan 24, 2024

JeMPI Local Deployment Script

Overview

This Bash script is designed for deploying JeMPI locally with various options. It performs tasks such as installing Docker, SDKMAN, Java, Maven, and SBT, setting up the environment configuration, creating a Docker registry, pulling and pushing Docker images, initializing the Docker Swarm, building the entire stack, rebooting, restarting, tearing down, and destroying JeMPI.

Usage

  1. Set JEMPI_HOME Environment Variable:

    export JAVA_VERSION=21.0.1-tem
    JEMPI_CONFIGURATION_PATH=$JEMPI_HOME/JeMPI_Apps/JeMPI_Configuration/reference/config-reference.json
    
  2. Run the Script:

    Location of file - JeMPI/devops/linux/docker/deployment
    bash local-deployment.sh
  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: Backup Database.
    • Option 5: Restart JeMPI.
    • Option 6: Down JeMPI.
    • Option 7: Destroy JeMPI (This process will wipe all data).

Script Functions

install_docker()

Check if Docker is installed and install it if not.

install_sdkman_and_java_sbt_maven()

Installs SDKMAN, Java, Maven, and SBT using SDKMAN.

hostname_setup()

Sets up hostname and IP address in the Hosts file.

run_enviroment_configuration_and_helper_script()

Navigate to the environment configuration directory, run environment configuration scripts, and Docker helper scripts.

run_field_configuration_file()

Runs JeMPI configuration with the specified configuration file path.

initialize_swarm()

Check if the Docker Swarm is running and initialize it if not.

pull_docker_images_and_push_local()

Creates a Docker registry, pulls Docker images from the hub, and pushes them to the local registry.

build_all_stack_and_reboot()

Builds and reboots the entire JeMPI stack.

initialize_db_build_all_stack_and_reboot()

Creates a database, builds the entire JeMPI stack, and reboots.

Notes

  • The script prompts for user input to select an option.
  • Confirmations are requested for critical actions.
  • Use Ctrl+Y for "Yes" confirmation to Destroy all systems.
  • Customize the script as needed for your specific deployment requirements.

Copy link
Collaborator

@walisc walisc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks decent. Still to test this a bit more, but fin to merge as changes are quite isolated.

@@ -26,12 +26,6 @@ pushd .

echo

pushd helper/keycloak
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @sushantpatil1214 . I am just going to revert this for now, as all the old scripts should work as before, until we have fully tested the new scripts. Currently this would break the devops/linux/docker/d-stack-3-reboot.sh

@@ -31,6 +31,8 @@ pushd .

mkdir -p ${DATA_POSTGRESQL_DIR}
cp ./conf/postgres/*.* ${DATA_POSTGRESQL_DIR}/.
mkdir -p ${DATA_POSTGRESQL_DB_DIR}
chmod 777 ${DATA_POSTGRESQL_DB_DIR}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use 777 for permission, To permissive, and presents a security as any random process will have full control of that folder

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p.s have update this as well 👍🏽

@walisc walisc merged commit a583883 into dev Jan 26, 2024
@walisc walisc deleted the automation_Script branch January 26, 2024 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants