-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OZ-522: Rename 'install-latest.sh' to 'install-stable.sh'
- Loading branch information
1 parent
44bfc3f
commit 552f2aa
Showing
2 changed files
with
102 additions
and
101 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
install-stable.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
# | ||
# Helper script to download and install Ozone for trial purposes | ||
# | ||
|
||
# Set colors | ||
export TEXT_BLUE=`tput setaf 4` | ||
export TEXT_RED=`tput setaf 1` | ||
export BOLD=`tput bold` | ||
export RESET_FORMATTING=`tput sgr0` | ||
INFO="$TEXT_BLUE$BOLD[INFO]$RESET_FORMATTING" | ||
WARN="$TEXT_RED$BOLD[WARN]$RESET_FORMATTING" | ||
ERROR="$TEXT_RED$BOLD[ERROR]$RESET_FORMATTING" | ||
|
||
# Introduction message | ||
echo " Installation script for ${BOLD}Ozone FOSS${RESET_FORMATTING} (for testing and demo purposes only)." | ||
echo "" | ||
echo " See https://docs.ozone-his.com/ for how to set it up for production." | ||
echo "" | ||
|
||
|
||
# TODO: Upon release, replace this with the latest stable version | ||
ozoneVersion=${1:-1.0.0-SNAPSHOT} | ||
|
||
echo "$INFO Ozone version: $ozoneVersion" | ||
|
||
ozoneInstallFolder="$PWD/ozone" | ||
# Check if ozone/ folder is already present | ||
if [ -d "${ozoneInstallFolder}" ] | ||
then | ||
echo "$WARN Ozone installation directory (${ozoneInstallFolder}/) already exists." | ||
while true; do | ||
read -p "Do you want to overwrite? [y/n]" choice | ||
case "$choice" in | ||
y|Y ) rm -r ${ozoneInstallFolder}/; | ||
break;; | ||
n|N ) echo "$INFO Aborting."; | ||
exit 0;; | ||
* ) echo "Please enter y, Y, n or N.";; | ||
esac | ||
done | ||
fi | ||
|
||
# Download Maven and install locally | ||
echo "$INFO Installing Maven $mavenVersion..." | ||
mavenVersion="3.9.6" | ||
mvn=apache-maven-${mavenVersion}/bin/mvn | ||
if [ -f "$mvn" ] | ||
then | ||
echo "$INFO Maven $mavenVersion already present in the current folder." | ||
echo "$INFO Skipping Maven installation..." | ||
else | ||
echo "$INFO Downloading Maven $mavenVersion..." | ||
curl -O https://dlcdn.apache.org/maven/maven-3/${mavenVersion}/binaries/apache-maven-${mavenVersion}-bin.tar.gz | ||
tar -xzvf apache-maven-${mavenVersion}-bin.tar.gz | ||
fi | ||
|
||
# Download Ozone | ||
echo "$INFO Downloading Ozone $ozoneVersion..." | ||
$mvn dependency:get \ | ||
-DgroupId=com.ozonehis \ | ||
-DartifactId=ozone \ | ||
-Dversion=${ozoneVersion} \ | ||
-Dpackaging=zip \ | ||
-DremoteRepositories=https://nexus.mekomsolutions.net/repository/maven-public \ | ||
-Dtransitive=false | ||
|
||
# Copy and Unpack | ||
echo "$INFO Extracting Ozone..." | ||
$mvn dependency:copy \ | ||
-Dartifact=com.ozonehis:ozone:${ozoneVersion}:zip \ | ||
-DoutputDirectory=./ \ | ||
-DuseBaseVersion=true | ||
|
||
# Account for some inconsistencies in some systems where Maven copies the files without a timestamp. | ||
# Only rename the file if it is time-stamped. | ||
if [ ! -f "ozone-${ozoneVersion}.zip" ] | ||
then | ||
echo "$INFO Rename to 'ozone-${ozoneVersion}.zip'..." | ||
mv ozone-1.0.0-*.zip ozone-${ozoneVersion}.zip | ||
fi | ||
|
||
echo "$INFO Unzipping..." | ||
unzip ozone-${ozoneVersion}.zip -d ${ozoneInstallFolder} | ||
rm ozone-${ozoneVersion}.zip | ||
pushd ozone/run/docker/scripts/ | ||
|
||
echo "" | ||
echo "$INFO Ozone installed at $ozoneInstallFolder" | ||
echo "" | ||
echo "---" | ||
echo "" | ||
echo " Type in the following command to run Ozone:" | ||
echo "" | ||
echo " ${BOLD}cd ozone/run/docker/scripts/" | ||
echo " ./start-demo.sh"$RESET_FORMATTING | ||
echo "" | ||
echo "(💡 Refer to https://docs.ozone-his.com/ for more information)" | ||
echo "" |