Skip to content

Commit

Permalink
update installer
Browse files Browse the repository at this point in the history
  • Loading branch information
mozzy11 committed Oct 31, 2024
1 parent b977ac5 commit 69a7a59
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 29 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build-installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ jobs:
run: ./build.sh ${{github.ref_name}} develop

- name: check installer
run: ls OEDockerImages
run: ls OEDockerInstaller


- name: Find installer file
id: find_file
run: |
# Find the file in OEDockerImages with .tar.gz extension
FILE_PATH=$(find OEDockerImages -name "*.tar.gz" -print -quit)
# Find the file in OEDockerInstaller with .tar.gz extension
FILE_PATH=$(find OEDockerInstaller -name "*.tar.gz" -print -quit)
if [ -z "$FILE_PATH" ]; then
echo "No .tar.gz file found in OEDockerImages directory."
echo "No .tar.gz file found in OEDockerInstaller directory."
exit 1
fi
echo "File path: $FILE_PATH"
Expand Down
16 changes: 5 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,15 @@ For offline Installtion,where theres no Intenet acess,

1. Download the prepackaged Docker images from the [Release Artifacts](https://github.com/I-TECH-UW/openelis-docker/releases)

1. Unzip the OpenELIS-Global Docker images zip file
1. Unzip the OpenELIS-Global Docker Installer zip file

tar xzf OpenELIS-Global_<verion>_docker_images.tar.gz
tar xzf OpenELIS-Global_<verion>_docker_installer.tar.gz

1. Move to directory of the Unziped Docker Images file

cd OpenELIS-Global_<verion>_docker_images
1. Load the images by running
cd OpenELIS-Global_<verion>_docker_installer
1. Load the images and start the containers by running

./loadImages.sh
./run.sh

1. Then Move to the root of this project

cd openelis-docker
1. Start the containers

docker-compose up -d

9 changes: 6 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
projectVersion=${1:-"latest"}
dockerVersion=${2:-"develop"}

INSTALLER_CREATION_DIR="OEDockerImages"
INSTALLER_CREATION_DIR="OEDockerInstaller"
CALL_DIR=$PWD

cd ${CALL_DIR}
Expand All @@ -23,11 +23,14 @@ echo "creating docker images"

createLinuxInstaller() {
context="OpenELIS-Global"
installerName="${context}_${projectVersion}_docker_images"
installerName="${context}_${projectVersion}_docker_installer"

echo "creating installer for context ${context}"
mkdir -p ${INSTALLER_CREATION_DIR}/${installerName}/dockerImage
cp ./install/loadImages.sh ${INSTALLER_CREATION_DIR}/${installerName}/loadImages.sh
mkdir -p ${INSTALLER_CREATION_DIR}/${installerName}/volumes
cp ./install/run.sh ${INSTALLER_CREATION_DIR}/${installerName}/run.sh
cp docker-compose.yml ${INSTALLER_CREATION_DIR}/${installerName}/docker-compose.yml
cp -r volumes/* ${INSTALLER_CREATION_DIR}/${installerName}/volumes
cp OpenELIS-Global_DockerImage.tar.gz ${INSTALLER_CREATION_DIR}/${installerName}/dockerImage/OpenELIS-Global_DockerImage.tar.gz
cp Postgres_DockerImage.tar.gz ${INSTALLER_CREATION_DIR}/${installerName}/dockerImage/Postgres_DockerImage.tar.gz
cp JPAServer_DockerImage.tar.gz ${INSTALLER_CREATION_DIR}/${installerName}/dockerImage/JPAServer_DockerImage.tar.gz
Expand Down
11 changes: 0 additions & 11 deletions install/loadImages.sh

This file was deleted.

29 changes: 29 additions & 0 deletions install/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
cd dockerImage
gunzip -c OpenELIS-Global_DockerImage.tar.gz | docker load
gunzip -c Postgres_DockerImage.tar.gz | docker load
gunzip -c JPAServer_DockerImage.tar.gz | docker load
gunzip -c AutoHeal_DockerImage.tar.gz | docker load
gunzip -c NGINX_DockerImage.tar.gz | docker load
gunzip -c ReactFrontend_DockerImage.tar.gz | docker load
gunzip -c Certs_DockerImage.tar.gz | docker load

cd ..

# Check Docker version
docker_version=$(docker --version | awk '{print $3}' | sed 's/,//')
major_version=$(echo "$docker_version" | cut -d'.' -f1)

# Check if major version is 20 or higher (Docker CLI v2.x+)
if [[ "$major_version" -ge 20 ]]; then
# Use "docker compose" (no dash)
compose_command="docker compose"
else
# Use "docker-compose" (with dash)
compose_command="docker-compose"
fi

# Run docker-compose up -d or docker compose up -d based on version
$compose_command up -d


0 comments on commit 69a7a59

Please sign in to comment.