Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make develop.sh and test.sh compatible with compose v2 #2184

Merged
merged 1 commit into from
Sep 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions develop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,16 @@ if [[ ! -d "docker" ]]; then
exit -1
fi

echo "Checking docker compose version"
if docker compose version &> /dev/null; then
DOCKER_COMPOSE_CMD="docker compose"
else
DOCKER_COMPOSE_CMD="docker-compose"
fi


function invoke_docker_compose {
exec docker-compose -f docker/docker-compose.yml \
exec $DOCKER_COMPOSE_CMD -f docker/docker-compose.yml \
-p listenbrainz \
"$@"
}
Expand All @@ -31,7 +39,7 @@ function open_timescale_shell {
}

function invoke_docker_compose_spark {
exec docker-compose -f docker/docker-compose.spark.yml -f docker/docker-compose.spark.override.yml \
exec $DOCKER_COMPOSE_CMD -f docker/docker-compose.spark.yml -f docker/docker-compose.spark.override.yml \
-p listenbrainzspark \
"$@"
}
Expand Down
14 changes: 11 additions & 3 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,22 @@ if [[ ! -d "docker" ]]; then
exit 255
fi

echo "Checking docker compose version"
if docker compose version &> /dev/null; then
DOCKER_COMPOSE_CMD="docker compose"
else
DOCKER_COMPOSE_CMD="docker-compose"
fi


function invoke_docker_compose {
docker-compose -f $COMPOSE_FILE_LOC \
$DOCKER_COMPOSE_CMD -f $COMPOSE_FILE_LOC \
-p $COMPOSE_PROJECT_NAME \
"$@"
}

function invoke_docker_compose_spark {
docker-compose -f $SPARK_COMPOSE_FILE_LOC \
$DOCKER_COMPOSE_CMD -f $SPARK_COMPOSE_FILE_LOC \
-p $SPARK_COMPOSE_PROJECT_NAME \
"$@"
}
Expand Down Expand Up @@ -213,7 +221,7 @@ if [ "$1" == "-s" ]; then
fi

if [ "$1" == "-d" ]; then
echo "Running docker-compose down"
echo "Running docker compose down"
unit_dcdown
exit 0
fi
Expand Down