From 3ce1897fb2583f49f760a1bbfed0b0305c896b79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Franco?= Date: Thu, 3 Sep 2026 21:30:46 +0200 Subject: [PATCH] fix(demo): pdo_mysql and MySQL retry for demo-smoke CI Install the MySQL PDO driver in the demo FrankenPHP image and retry Doctrine setup until the database accepts connections, fixing flaky scheduled demo-smoke runs. --- demo/symfony8/Dockerfile | 2 +- demo/symfony8/Makefile | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/demo/symfony8/Dockerfile b/demo/symfony8/Dockerfile index c06c281..be97b20 100644 --- a/demo/symfony8/Dockerfile +++ b/demo/symfony8/Dockerfile @@ -1,7 +1,7 @@ FROM dunglas/frankenphp:1-php8.5-alpine RUN apk add --no-cache git unzip bash sqlite -RUN install-php-extensions intl zip pdo_sqlite +RUN install-php-extensions intl zip pdo_mysql COPY --from=composer:2 /usr/bin/composer /usr/bin/composer RUN git config --global --add safe.directory /app && \ diff --git a/demo/symfony8/Makefile b/demo/symfony8/Makefile index 864af09..52c15c4 100644 --- a/demo/symfony8/Makefile +++ b/demo/symfony8/Makefile @@ -69,7 +69,20 @@ cache-clear: ensure-up $(DOCKER_COMPOSE) exec php php bin/console cache:clear link-bundle: ensure-up - $(DOCKER_COMPOSE) exec php sh -c "mkdir -p var/data && rm -rf vendor/nowo-tech/http-log-bundle && ln -sf /var/http-log-bundle vendor/nowo-tech/http-log-bundle && php bin/console doctrine:schema:update --force --complete && php bin/console cache:clear" + @echo "Waiting for MySQL from PHP container..." + @i=0; \ + while [ $$i -lt 30 ]; do \ + if $(DOCKER_COMPOSE) exec php sh -c "mkdir -p var/data && rm -rf vendor/nowo-tech/http-log-bundle && ln -sf /var/http-log-bundle vendor/nowo-tech/http-log-bundle && php bin/console doctrine:schema:update --force --complete && php bin/console cache:clear" 2>/dev/null; then \ + break; \ + fi; \ + i=$$((i+1)); \ + sleep 2; \ + done; \ + if [ $$i -ge 30 ]; then \ + echo "MySQL not reachable from demo PHP container"; \ + $(DOCKER_COMPOSE) logs --tail=50 database php || true; \ + exit 1; \ + fi update: ensure-up $(DOCKER_COMPOSE) exec -T -e COMPOSER_MEMORY_LIMIT=-1 php composer update --no-interaction