Auto-detect docker-compose (#13754)

This commit is contained in:
Paul Rogers 2023-02-06 07:59:45 -08:00 committed by GitHub
parent 9100a61bf6
commit f28c06515b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 5 deletions

View File

@ -165,20 +165,31 @@ function docker_file {
# Print environment for debugging
#env
# Determine if docker-compose is available. If not, assume Docker supports
# the compose subcommand
set +e
if which docker-compose > /dev/null
then
DOCKER_COMPOSE='docker-compose'
else
DOCKER_COMPOSE='docker compose'
fi
set -e
case $CMD in
"-h" )
usage
;;
"help" )
usage
docker-compose help
$DOCKER_COMPOSE help
;;
"up" )
category $*
echo "Starting cluster $DRUID_INTEGRATION_TEST_GROUP"
build_shared_dir
cd $CLUSTER_DIR
docker-compose `docker_file` up -d
$DOCKER_COMPOSE `docker_file` up -d
# Enable the following for debugging
#show_status
;;
@ -192,12 +203,11 @@ case $CMD in
# Enable the following for debugging
#show_status
cd $CLUSTER_DIR
echo docker-compose `docker_file` $CMD
docker-compose `docker_file` $CMD
$DOCKER_COMPOSE `docker_file` $CMD
;;
"*" )
category $*
cd $CLUSTER_DIR
docker-compose `docker_file` $CMD
$DOCKER_COMPOSE `docker_file` $CMD
;;
esac