Skip to content

Commit

Permalink
OZ-627: Ensure Docker Compose up command is re-applied when Ozone pro…
Browse files Browse the repository at this point in the history
…ject is already running
  • Loading branch information
corneliouzbett committed Nov 18, 2024
1 parent d703ff4 commit 1681dee
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,11 @@ echo "$PROJECT_NAME" > /tmp/project_name.txt

if ! isOzoneRunning "$PROJECT_NAME"; then
echo "$INFO Starting Ozone project with name: $PROJECT_NAME"
else
echo "$WARN Ozone project with name: $PROJECT_NAME is already running"
echo "$INFO Re-applying Docker Compose up command to ensure all services are up-to-date..."
fi

# Check if an instance of Ozone is already running
suffix=0
while isOzoneRunning "$PROJECT_NAME"; do
echo "$WARN An instance of Ozone is already running with the name: $PROJECT_NAME"
suffix=$((suffix + 1))
export PROJECT_NAME="$PROJECT_NAME-$suffix"
echo "$INFO Starting a new instance of Ozone with name: $PROJECT_NAME"
echo "$PROJECT_NAME" > /tmp/project_name.txt
done

INSTALLED_DOCKER_VERSION=$(docker version -f "{{.Server.Version}}")
MINIMUM_REQUIRED_DOCKER_VERSION_REGEX="^((([2-9][1-9]|[3-9][0]|[0-9]{3,}).*)|(20\.([0-9]{3,}|[1-9][1-9]|[2-9][0]).*)|(20\.10\.([0-9]{3,}|[2-9][0-9]|[1][3-9])))"
if [[ $INSTALLED_DOCKER_VERSION =~ $MINIMUM_REQUIRED_DOCKER_VERSION_REGEX ]]; then
Expand Down

0 comments on commit 1681dee

Please sign in to comment.