From c04b6876f62b07b42aa14afbbdeb3201604c5003 Mon Sep 17 00:00:00 2001 From: Galindo97 Date: Wed, 20 May 2026 13:08:51 -0500 Subject: [PATCH] =?UTF-8?q?fix(jenkins):=20corregir=20captura=20de=20HTTP?= =?UTF-8?q?=20status=20en=20verificaci=C3=B3n=20de=20Keycloak?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit curl -sf falla con exit!=0 en HTTP >=400, disparando || echo '000' y concatenando '502000' en lugar de '502'. Cambiado a curl -s para capturar el código real sin que el flag -f interfiera. Co-Authored-By: Claude Sonnet 4.6 --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 25a12529..f24f7ace 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -218,7 +218,9 @@ pipeline { # (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_STATUS=$(curl -sf --max-time 10 -o /dev/null -w "%{http_code}" \ + # -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}" \ -X POST "$KC_TOKEN_EP" \ -d "grant_type=password&client_id=anexo76-frontend&username=${E2E_TEST_USER}&password=${E2E_TEST_PASSWORD}&scope=openid" \ 2>/dev/null || echo "000")