From ae4644cb75aa4a1b877f68f7dfb21467d13e0f41 Mon Sep 17 00:00:00 2001 From: AlexeerCT Date: Fri, 24 Apr 2026 14:00:28 -0500 Subject: [PATCH] Refactor Alembic command execution in Jenkinsfile for improved reliability - Changed the Alembic upgrade command to use a variable for the command string, preventing issues with inline double quotes in the shell execution. - Updated comments to clarify the changes made and their impact on the command execution context within the Docker environment. --- Jenkinsfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 727e93d2..8e19a84d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -284,8 +284,10 @@ pipeline { e2e_compose_fail_logs exit 1 fi - # --entrypoint "" se pierde en sh/Jenkins (Docker toma "backend" como entrypoint, rompe o ignora CWD/ini) - if ! e2e_compose run --rm --no-deps --entrypoint /bin/sh backend -c "set -eux; test -f /app/alembic.ini; cd /app; exec alembic -c /app/alembic.ini upgrade head"; then + # Cuerpo de -c en variable: las comillas dobles inline en "if ! e2e_compose run ..." se colaban en + # el shell de Jenkins y -c quedaba solo con "set"; el resto se ejecutaba en el host (no existe /app) + E2E_ALEMBIC_CMD='set -eux; test -f /app/alembic.ini; cd /app; exec alembic -c /app/alembic.ini upgrade head' + if ! e2e_compose run --rm --no-deps --entrypoint /bin/sh backend -c "$E2E_ALEMBIC_CMD"; then echo "ERROR: falló alembic upgrade head (job previo al stack completo)" e2e_compose_fail_logs exit 1