From c0bb0ff2f41cf6b27fa34d61a39f8efa48f77687 Mon Sep 17 00:00:00 2001 From: Helder Oliveira Date: Tue, 21 Nov 2023 18:55:10 +0000 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20check=20compose=20stack?= =?UTF-8?q?=20running=20and=20handle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/update | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/update b/scripts/update index 9d8e1a9..5845cda 100755 --- a/scripts/update +++ b/scripts/update @@ -17,6 +17,20 @@ if ! git pull origin main; then exit 1 fi +if ! docker compose ps --format "{{.Service}} {{.State}}" | grep 'llm_indexer running' || ! docker compose ps --format "{{.Service}} {{.State}}" | grep 'discordjs-bot'; then + echo "⚠️ Warning: Docker compose stack is down" + echo "🤖 Should start compose stack, be patient..." + + if ! docker compose up; then + echo "👹 Oops! Failed to start compose stack" + + exit 1 + fi +fi + + if ! docker compose restart; then echo "👹 Oops! Failed to restart docker compose" + + exit 1 fi