This is an automated email from the ASF dual-hosted git repository.

abhishek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git


The following commit(s) were added to refs/heads/master by this push:
     new f28c06515b Auto-detect docker-compose (#13754)
f28c06515b is described below

commit f28c06515b8ac1c2c3592a5d601ecd5df66c94de
Author: Paul Rogers <[email protected]>
AuthorDate: Mon Feb 6 07:59:45 2023 -0800

    Auto-detect docker-compose (#13754)
---
 integration-tests-ex/cases/cluster.sh | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/integration-tests-ex/cases/cluster.sh 
b/integration-tests-ex/cases/cluster.sh
index 16e0a9d5a2..3c5bea3f81 100755
--- a/integration-tests-ex/cases/cluster.sh
+++ b/integration-tests-ex/cases/cluster.sh
@@ -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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to