From 0c093a897913279f76a7830f07f65f2613f728da Mon Sep 17 00:00:00 2001 From: "M. Palanikannan" <73993394+Palanikannan1437@users.noreply.github.com> Date: Fri, 21 Jun 2024 23:28:03 +0530 Subject: [PATCH] added check if docker daemon is running or not before starting the scripts for both gitpod and local scripts (#218) --- gitpod-scripts/startCloudDevBackend.sh | 6 ++++++ gitpod-scripts/startCloudDevEnv.sh | 5 +++++ gitpod-scripts/startCloudDevStrapi.sh | 5 +++++ startdevenv.sh | 5 +++++ 4 files changed, 21 insertions(+) diff --git a/gitpod-scripts/startCloudDevBackend.sh b/gitpod-scripts/startCloudDevBackend.sh index 463ef858..ad2b1fab 100644 --- a/gitpod-scripts/startCloudDevBackend.sh +++ b/gitpod-scripts/startCloudDevBackend.sh @@ -1,6 +1,12 @@ #!/bin/sh +if ! docker info > /dev/null 2>&1; then + echo "Docker is not running, please start the Docker daemon and try again! 💪" + exit 1 +fi + echo "--Starting Superprofile Backend--" + cd superprofile sh initFaunaOnce.sh $1 cd .. diff --git a/gitpod-scripts/startCloudDevEnv.sh b/gitpod-scripts/startCloudDevEnv.sh index 72afaa6b..9ec5f28c 100644 --- a/gitpod-scripts/startCloudDevEnv.sh +++ b/gitpod-scripts/startCloudDevEnv.sh @@ -20,6 +20,11 @@ check_and_set_next_port() { fi } +if ! docker info > /dev/null 2>&1; then + echo "Docker is not running, please start the Docker daemon and try again! 💪" + exit 1 +fi + check_and_set_next_port export NEXT_PUBLIC_PORT=$NEXTJS_PORT diff --git a/gitpod-scripts/startCloudDevStrapi.sh b/gitpod-scripts/startCloudDevStrapi.sh index b19ce961..3d182cc2 100644 --- a/gitpod-scripts/startCloudDevStrapi.sh +++ b/gitpod-scripts/startCloudDevStrapi.sh @@ -20,6 +20,11 @@ check_and_set_strapi_port() { fi } +if ! docker info > /dev/null 2>&1; then + echo "Docker is not running, please start the Docker daemon and try again! 💪" + exit 1 +fi + check_and_set_strapi_port printf '\nNEXT_PUBLIC_STRAPI_API_URL'="http://127.0.0.1:$STRAPI_PORT" >> app/.env diff --git a/startdevenv.sh b/startdevenv.sh index 889734f1..3013da4a 100644 --- a/startdevenv.sh +++ b/startdevenv.sh @@ -36,6 +36,11 @@ check_and_set_next_port() { fi } +if ! docker info > /dev/null 2>&1; then + echo "Docker is not running, please start the Docker daemon and try again! 💪" + exit 1 +fi + sh startBackend.sh $1 check_and_set_strapi_port