Skip to content

Commit c41c736

Browse files
authored
Merge pull request #3951 from alephdata/chore/wait-for-pg
Use pg_isready in make upgrade instead of sleep
2 parents 19adc88 + 8feb82c commit c41c736

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ format-check-ui:
4343

4444
upgrade: build
4545
$(COMPOSE) up -d postgres elasticsearch
46-
sleep 10
46+
# wait for postgres to be available
47+
@$(COMPOSE) exec postgres pg_isready --timeout=30
48+
# wait for elasticsearch to be available
49+
@$(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'"
4750
$(APPDOCKER) aleph upgrade
4851

4952
api: services

0 commit comments

Comments
 (0)