Skip to content
Snippets Groups Projects
Commit 176fb656 authored by Corné Lukken's avatar Corné Lukken
Browse files

L2SS-988: Prevent waiting on services without health property

parent ee212a2c
No related branches found
No related tags found
No related merge requests found
......@@ -224,16 +224,20 @@ restart: ## restart a service (usage: make restart <servicename>)
attach: ## attach a service to an existing Tango network
$(DOCKER_COMPOSE_ARGS) docker-compose $(ATTACH_COMPOSE_FILE_ARGS) up --no-recreate -d $(SERVICE)
time := 0
await: ## Await every container with total max timeout of 300, do not reset timeout
time=0
for i in $(SERVICE); do \
current_service=$$($(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) ps -q $${i}); \
if [ -z "$${current_service}" ]; then \
continue; \
fi; \
service_has_health=$$(docker inspect -f '{{.State.Health.Status}}' $${current_service}); \
if [ -z "$${service_has_health}" ]; then \
continue; \
fi; \
while [ "$$(docker inspect -f '{{.State.Health.Status}}' $${current_service})" != "healthy" ] ; do \
sleep 1; \
time=$$(expr $${time} + 1); \
time=$$(expr $$time + 1); \
if [ $${time} -gt $(TIMEOUT) ]; then \
echo "Timeout reached waiting for $${i} to become healthy"; \
exit 1; \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment