From 9c0463b28ee5513076de21446e702a98c203457f Mon Sep 17 00:00:00 2001
From: Thomas Juerges <203795-tjuerges@users.noreply.gitlab.com>
Date: Tue, 25 May 2021 16:08:53 +0200
Subject: [PATCH] L2SS-225:  Add a check that docker compose is installed

---
 bootstrap/sbin/rebuild_system_from_scratch.sh | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/bootstrap/sbin/rebuild_system_from_scratch.sh b/bootstrap/sbin/rebuild_system_from_scratch.sh
index f27635f00..8cf58c14a 100755
--- a/bootstrap/sbin/rebuild_system_from_scratch.sh
+++ b/bootstrap/sbin/rebuild_system_from_scratch.sh
@@ -9,6 +9,22 @@ if [ ! -d ${HOME_DIR}/bootstrap ]; then
     exit 1
 fi
 
+# Check if Docker compose can be found.
+DOCKER_COMPOSE="docker compose version"
+${DOCKER_COMPOSE} 2>&1>/dev/null
+ret=${?}
+if [ ${ret} -ne 0 ]; then
+    DOCKER_COMPOSE="docker-compose version"
+    ${DOCKER_COMPOSE} 2>&1>/dev/null
+    ret=${?}
+fi
+if [ ${ret} -eq 0 ]; then
+    echo -e"\tFound Docker Compose:  ${DOCKER_COMPOSE}"
+else
+    echo "This system appears to not have Docker compose installed.  This means that the system cannot be rebuilt with this script."
+    return 1
+fi
+
 # Save for the moment when tango will be cloned.
 OLD_HOME_DIR=${HOME_DIR}.old
 
-- 
GitLab