Some checks failed
Telegram Mini App Shop Builder / Compute version metadata (push) Has been cancelled
Telegram Mini App Shop Builder / Run Frontend tests (push) Has been cancelled
Telegram Mini App Shop Builder / Run Backend tests (push) Has been cancelled
Telegram Mini App Shop Builder / Run PHP_CodeSniffer (push) Has been cancelled
Telegram Mini App Shop Builder / Build module. (push) Has been cancelled
Telegram Mini App Shop Builder / release (push) Has been cancelled
29 lines
537 B
Bash
Executable File
29 lines
537 B
Bash
Executable File
#!/bin/bash
|
|
|
|
SERVICES=("web" "mysql")
|
|
|
|
function check_containers {
|
|
for service in "${SERVICES[@]}"; do
|
|
if ! docker compose ps $service | grep "Up" > /dev/null; then
|
|
return 1
|
|
fi
|
|
done
|
|
return 0
|
|
}
|
|
|
|
echo "Waiting for docker containers..."
|
|
|
|
MAX_WAIT_TIME=60
|
|
WAIT_TIME=0
|
|
|
|
while ! check_containers; do
|
|
if [ $WAIT_TIME -ge $MAX_WAIT_TIME ]; then
|
|
echo "Containers have not started within $MAX_WAIT_TIME seconds. Exit."
|
|
exit 1
|
|
fi
|
|
sleep 1
|
|
WAIT_TIME=$((WAIT_TIME + 1))
|
|
done
|
|
|
|
echo "All docker containers executed."
|