Skip to content

Commit

Permalink
Merge pull request #17 from mozzy11/main
Browse files Browse the repository at this point in the history
UPdate Docker installer
  • Loading branch information
mozzy11 authored Oct 31, 2024
2 parents dfd9cea + 1e50da1 commit 2f5fa9d
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 19 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
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,24 @@ You can find more information on how to set up OpenELIS at our [docs page](http:

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. Download the OpenELIS-Global Docker Installer zip file 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
1. Move to directory of the Unziped OpenELIS-Global Docker Installer file

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

./loadImages.sh
1. For installing OpenELIS-Global2 the first time ,Load the images and start the containers by running

1. Then Move to the root of this project
./run.sh

cd openelis-docker
1. Start the containers
1. For Upgrading OpenELIS-Global2 with an existing docker installer ,only Load the images in the new docker installer and re-satrt Global Global containers in your existing old Docker installer

docker-compose up -d
./upgrade.sh



10 changes: 7 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,15 @@ 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 ./install/upgrade.sh ${INSTALLER_CREATION_DIR}/${installerName}/upgrade.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
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ services:
- ./volumes/database/database.env
volumes:
# preserves the database between containers
- db-data:/var/lib/postgresql/data
- ./volumes/database/data:/var/lib/postgresql/data
# files here will run on install
- ./volumes/database/dbInit:/docker-entrypoint-initdb.d
logging: *local-logging
Expand Down
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


1 change: 1 addition & 0 deletions install/loadImages.sh → install/upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ gunzip -c ReactFrontend_DockerImage.tar.gz | docker load
gunzip -c Certs_DockerImage.tar.gz | docker load



0 comments on commit 2f5fa9d

Please sign in to comment.