Skip to content

Commit

Permalink
Remove extra start stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
acetousk committed Aug 31, 2024
1 parent e60280c commit 98133b0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 71 deletions.
1 change: 0 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
# To import data from the docker host using port 5432 mapped for 127.0.0.1 only use something like this:
# $ psql -h 127.0.0.1 -p 5432 -U moqui -W moqui < pg-dump.sql

version: "2"
services:
moqui-server:
image: moqui
Expand Down
70 changes: 0 additions & 70 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,76 +13,6 @@ COMPONENT_SET=${COMPONENT_SET:=""}
RUN_LOCAL_SEARCH=${RUN_LOCAL_SEARCH:="true"}
search_name=${search_name:="opensearch"}

# Function to check if a command is available
command_exists() {
command -v "$1" &> /dev/null
}

# Function to install SDKMAN!
install_sdkman() {
echo "Installing SDKMAN!..."
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
}

# Function to source SDKMAN!
source_sdkman() {
if [ -f "$HOME/.sdkman/bin/sdkman-init.sh" ]; then
source "$HOME/.sdkman/bin/sdkman-init.sh"
else
echo "SDKMAN! not found. Attempting to install SDKMAN!..."
install_sdkman
fi
}

# Check if Java 11 Temurin is installed
JAVA_INSTALLED=false
if command_exists java; then
JAVA_VERSION=$(java -version 2>&1 | awk -F '"' '/version/ {print $2}' | cut -d'.' -f1-2)
if [[ "$JAVA_VERSION" == "11.0" ]]; then
JAVA_INSTALLED=true
fi
fi

# Check if Gradle 7.4.1 is installed
GRADLE_INSTALLED=false
if command_exists gradle; then
GRADLE_VERSION=$(gradle -v | awk '/Gradle/ {print $2}')
if [[ "$GRADLE_VERSION" == "7.4.1" ]]; then
GRADLE_INSTALLED=true
fi
fi

# Install SDKMAN! and required packages if necessary
if [ "$JAVA_INSTALLED" = false ] || [ "$GRADLE_INSTALLED" = false ]; then
# Ensure SDKMAN! is installed and sourced
source_sdkman

# Install Java 11 Temurin if not installed
if [ "$JAVA_INSTALLED" = false ]; then
if ! sdk list java | grep -q "11.0.17-tem"; then
echo "Java 11 Temurin not found. Installing Java 11 Temurin..."
sdk install java 11.0.17-tem
else
echo "Java 11 Temurin is available but not in use. Setting as default..."
sdk use java 11.0.17-tem
fi
fi

# Install Gradle 7.4.1 if not installed
if [ "$GRADLE_INSTALLED" = false ]; then
if ! sdk list gradle | grep -q "7.4.1"; then
echo "Gradle 7.4.1 not found. Installing Gradle 7.4.1..."
sdk install gradle 7.4.1
else
echo "Gradle 7.4.1 is available but not in use. Setting as default..."
sdk use gradle 7.4.1
fi
fi
fi

echo "Java and Gradle setup complete."

# Rest of your script
if [ -f "$MOQUI_HOME/moqui-plus-runtime.war" ]; then
echo "Using already built moqui-plus-runtime.war"
Expand Down

0 comments on commit 98133b0

Please sign in to comment.