Skip to content

Commit

Permalink
OZ-196: Provide explicit env file location in start.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuisson committed Jan 11, 2024
1 parent 8858bfe commit a85be78
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
5 changes: 4 additions & 1 deletion scripts/go-to-scripts-dir.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/env bash

# Will be substituted at build time by the Maven Resource plugin filtering.
pushd ${project.build.directory}/${project.artifactId}-${project.version}/scripts
pushd ${project.build.directory}/${project.artifactId}-${project.version}/scripts/
echo "Moved to: $PWD"
echo ""
echo "(💡 Use 'popd' to move back to the repo root directory)"
4 changes: 2 additions & 2 deletions scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ if [[ $INSTALLED_DOCKER_VERSION =~ $MINIMUM_REQUIRED_DOCKER_VERSION_REGEX ]]; th
# Run Ozone
($dockerComposeOzoneCommand)

# Run the Apache2 Proxy service, if $TRAEFIK!=true
# Run the Nginx Proxy service, if $TRAEFIK!=true
if [ "$TRAEFIK" != "true" ]; then
dockerComposeProxyCommand="docker compose -p ozone $dockerComposeProxyCLIOptions up -d --build"
echo "$INFO Running Apache2 proxy service (\$TRAEFIK!=true)..."
echo "$INFO Running Nginx proxy service (\$TRAEFIK!=true)..."
echo ""
echo "$dockerComposeProxyCommand"
echo ""
Expand Down
13 changes: 8 additions & 5 deletions scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,22 @@ function setDockerComposeCLIOptions () {
export dockerComposeFilesCLIOptions="$dockerComposeFilesCLIOptions -f ../$file"
done

# Use the concatenated.env file if one is provided
# Set the default env file
export dockerComposeEnvFilePath="../.env"

# Override the default with the concatenated.env file if it is provided
concatenatedEnvFilePath="../concatenated.env"
if [ -f "$concatenatedEnvFilePath" ]; then
export dockerComposeEnvFileCLIOption="--env-file $concatenatedEnvFilePath"
export dockerComposeEnvFilePath="$concatenatedEnvFilePath"
fi

export dockerComposeOzoneCLIOptions="$dockerComposeEnvFileCLIOption $dockerComposeFilesCLIOptions"
export dockerComposeOzoneCLIOptions="--env-file $dockerComposeEnvFilePath $dockerComposeFilesCLIOptions"

# Set args for the proxy service
export dockerComposeProxyCLIOptions="$dockerComposeEnvFileCLIOption -f ../proxy/docker-compose.yml"
export dockerComposeProxyCLIOptions="--env-file $dockerComposeEnvFilePath -f ../proxy/docker-compose.yml"

# Set args for the demo service
export dockerComposeDemoCLIOptions="$dockerComposeEnvFileCLIOption -f ../demo/docker-compose.yml"
export dockerComposeDemoCLIOptions="--env-file $dockerComposeEnvFilePath -f ../demo/docker-compose.yml"
}

function setTraefikIP {
Expand Down

0 comments on commit a85be78

Please sign in to comment.