Skip to content

Commit

Permalink
Remove unnecessary profiles.
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrm50 committed May 22, 2024
1 parent b2d13ad commit 9d73fe5
Showing 1 changed file with 24 additions and 20 deletions.
44 changes: 24 additions & 20 deletions tools/docker-network/run.sh
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
#!/bin/bash

# Create a function to join an array of strings by a given character
function join { local IFS="$1"; shift; echo "$*"; }
function join {
local IFS="$1"
shift
echo "$*"
}

# Initialize variables
MONITORING=0
MINIMAL=0

# Loop over all arguments
for arg in "$@"
do
case $arg in
monitoring=*)
MONITORING="${arg#*=}"
shift
;;
minimal=*)
MINIMAL="${arg#*=}"
shift
;;
*)
# Unknown option
echo "Unknown argument: $arg"
echo 'Call with ./run.sh [monitoring=0|1] [minimal=0|1]'
exit 1
;;
esac
for arg in "$@"; do
case $arg in
monitoring=*)
MONITORING="${arg#*=}"
shift
;;
minimal=*)
MINIMAL="${arg#*=}"
shift
;;
*)
# Unknown option
echo "Unknown argument: $arg"
echo 'Call with ./run.sh [monitoring=0|1] [minimal=0|1]'
exit 1
;;
esac
done

export DOCKER_BUILDKIT=1
Expand Down Expand Up @@ -94,14 +97,15 @@ if [ $MONITORING -ne 0 ]; then
fi

if [ $MINIMAL -ne 0 ]; then
PROFILES+=("minimal")
echo "Minimal profile active"
else
PROFILES+=("full")
echo "Full profile active"
fi

export COMPOSE_PROFILES=$(join , ${PROFILES[@]})
echo $COMPOSE_PROFILES

docker compose up

echo "Clean up docker resources"
Expand Down

0 comments on commit 9d73fe5

Please sign in to comment.