From cf84378a2e4b4b97affb7d794737d397722be01a Mon Sep 17 00:00:00 2001 From: Galindo97 Date: Wed, 20 May 2026 13:16:35 -0500 Subject: [PATCH] fix(jenkins): usar URL de Workspace para Keycloak en E2E MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Keycloak vive en workspace.aduanasoft.com/kcauth, no en el servidor de Anexo76. A76_URL/kcauth devuelve 502 porque el proxy del servidor dev no rutea ese path a Keycloak. - KC_URL = https://workspace.aduanasoft.com/kcauth (variable de entorno, no secret — no es dato sensible) - E2E_KEYCLOAK_URL y KC_TOKEN_EP ahora usan KC_URL en lugar de A76_URL/kcauth Co-Authored-By: Claude Sonnet 4.6 --- Jenkinsfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f24f7ace..e5ae79e0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -22,6 +22,9 @@ pipeline { // Debe coincidir con @playwright/test del frontend (ver frontend/pnpm-lock.yaml) PLAYWRIGHT_IMAGE = 'mcr.microsoft.com/playwright:v1.56.1-noble' DEPLOY_PATH = '~/projects/anexo76' + // URL de Keycloak/Workspace accesible desde el agente Jenkins. + // Difiere de A76_URL/kcauth porque Keycloak vive en Workspace, no en el servidor de Anexo76. + KC_URL = 'https://workspace.aduanasoft.com/kcauth' } options { @@ -204,7 +207,7 @@ pipeline { -e VITE_KEYCLOAK_CLIENT_ID=anexo76-frontend \ -e KEYCLOAK_CLIENT_ID=anexo76-frontend \ -e ORIGIN=http://localhost:5173 \ - -e "E2E_KEYCLOAK_URL=${A76_URL}/kcauth" \ + -e "E2E_KEYCLOAK_URL=${KC_URL}" \ -e "E2E_TEST_USER=${E2E_USER}" \ -e "E2E_TEST_PASSWORD=${E2E_PASS}" \ -w /workspace/frontend \ @@ -217,7 +220,7 @@ pipeline { # Verificar que Keycloak acepta el password grant # (auth.setup.ts lo usa directamente — sin pasar por /login) echo "--- Verificando Keycloak token endpoint ---" - KC_TOKEN_EP="${E2E_KEYCLOAK_URL}/realms/master/protocol/openid-connect/token" + KC_TOKEN_EP="${KC_URL}/realms/master/protocol/openid-connect/token" # -s sin -f: curl no falla en HTTP 4xx/5xx, devuelve el código real # || echo "000" solo se activa si curl no puede conectar (timeout, DNS, etc.) KC_STATUS=$(curl -s --max-time 10 -o /dev/null -w "%{http_code}" \