From 8feb82cc82ce71a6b8b7505ca41dbc08240258fb Mon Sep 17 00:00:00 2001 From: Christian Stefanescu Date: Wed, 23 Oct 2024 10:05:54 +0200 Subject: [PATCH] chore: use pg_isready in make upgrade instead of sleep --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 591c7172f..ad3bc7709 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,10 @@ format-check-ui: upgrade: build $(COMPOSE) up -d postgres elasticsearch - sleep 10 + # wait for postgres to be available + @$(COMPOSE) exec postgres pg_isready --timeout=30 + # wait for elasticsearch to be available + @$(COMPOSE) exec elasticsearch timeout 30 bash -c "printf 'Waiting for elasticsearch'; until curl --silent --output /dev/null localhost:9200/_cat/health?h=st; do printf '.'; sleep 1; done; printf '\n'" $(APPDOCKER) aleph upgrade api: services