From 1bc9c69347795fbb2ea872d5d38648f9b27de292 Mon Sep 17 00:00:00 2001 From: AlexeerCT Date: Fri, 24 Apr 2026 14:07:02 -0500 Subject: [PATCH] Refactor Alembic command execution in Jenkinsfile and remove obsolete script - Updated the Alembic upgrade command in the Jenkinsfile to directly use Python for execution, eliminating reliance on a separate shell script that caused issues with command parsing. - Revised comments to clarify the changes and their implications for the command context during E2E testing. - Deleted the now-unnecessary jenkins-alembic-e2e.sh script to streamline the process. --- Jenkinsfile | 4 ++-- backend/scripts/jenkins-alembic-e2e.sh | 7 ------- 2 files changed, 2 insertions(+), 9 deletions(-) delete mode 100755 backend/scripts/jenkins-alembic-e2e.sh diff --git a/Jenkinsfile b/Jenkinsfile index e0509425..99181fa7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -284,8 +284,8 @@ pipeline { e2e_compose_fail_logs exit 1 fi - # Script en el repo: Groovy/CI mutila comillas de -c o asignación VAR='…;…' (mismo síntoma: test en host) - if ! e2e_compose run --rm --no-deps --entrypoint /bin/sh backend /app/scripts/jenkins-alembic-e2e.sh; then + # Sin sh -c ni .sh bajo /app: sin comillas frágiles y sin depender de un fichero no montado aún (push) + if ! e2e_compose run --rm --no-deps --entrypoint python3 backend -m alembic -c /app/alembic.ini upgrade head; then echo "ERROR: falló alembic upgrade head (job previo al stack completo)" e2e_compose_fail_logs exit 1 diff --git a/backend/scripts/jenkins-alembic-e2e.sh b/backend/scripts/jenkins-alembic-e2e.sh deleted file mode 100755 index 3583af10..00000000 --- a/backend/scripts/jenkins-alembic-e2e.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -# Ejecutado solo desde Jenkins E2E: docker compose run --entrypoint /bin/sh … backend /app/scripts/jenkins-alembic-e2e.sh -# (evita pasar cadenas con ';' a -c: Groovy/CI rompe comillas y parte el comando) -set -eux -test -f /app/alembic.ini -cd /app -exec alembic -c /app/alembic.ini upgrade head