diff --git a/Jenkinsfile b/Jenkinsfile index 7814fbcc..2001024d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,6 +8,8 @@ // - dev-server-host : Secret Text — hostname/IP del servidor dev // - dev-server-ssh : SSH Username with Private Key — llave privada para deploy // - a76-e2e-credentials : Username with password — usuario de prueba en Workspace +// - a76-sitar-api-url : Secret Text — URL del API SITAR (provee TC para "Consultar DOF") +// - a76-sitar-credentials : Username with password — credenciales del API SITAR // // El agente Jenkins solo necesita: Docker CLI @@ -308,6 +310,12 @@ pipeline { credentialsId: 'a76-e2e-credentials', usernameVariable: 'E2E_USER', passwordVariable: 'E2E_PASS' + ), + string(credentialsId: 'a76-sitar-api-url', variable: 'SITAR_API_URL'), + usernamePassword( + credentialsId: 'a76-sitar-credentials', + usernameVariable: 'SITAR_API_USER', + passwordVariable: 'SITAR_API_PASSWORD' ) ]) { sh ''' @@ -325,6 +333,12 @@ pipeline { cleanup() { echo "=== E2E cleanup ===" + # Dump logs del backend si el stack está arriba — ayuda a diagnosticar + # fallas de auth/SITAR/migraciones que de otro modo quedan opacas. + if docker compose -p "$PROJECT" -f docker-compose.e2e.yml ps -q backend >/dev/null 2>&1; then + echo "--- logs backend (últimas 200 líneas) ---" + docker compose -p "$PROJECT" -f docker-compose.e2e.yml logs --tail=200 backend 2>&1 || true + fi docker rm -f "$PLAYWRIGHT_C" >/dev/null 2>&1 || true docker compose -p "$PROJECT" -f docker-compose.e2e.yml down -v --remove-orphans >/dev/null 2>&1 || true docker rmi -f "$FE_IMAGE_E2E" >/dev/null 2>&1 || true diff --git a/docker-compose.e2e.yml b/docker-compose.e2e.yml index 2793a079..96213017 100644 --- a/docker-compose.e2e.yml +++ b/docker-compose.e2e.yml @@ -80,6 +80,12 @@ services: - VALKEY_URL=redis://valkey:6379/0 - HUB_URL=https://workspace.aduanasoft.com - APP_PUBLIC_URL=http://localhost:5173 + # SITAR — proveedor del tipo de cambio (botón "Consultar DOF" del dialog + # de ExchangeRateGuard). Sin estas vars el dialog nunca llena el input + # y auth.setup.ts falla. Las credenciales se inyectan desde Jenkins. + - SITAR_API_URL=${SITAR_API_URL:-} + - SITAR_API_USER=${SITAR_API_USER:-} + - SITAR_API_PASSWORD=${SITAR_API_PASSWORD:-} - CSV_IMPORT_STORAGE=minio - S3_ENDPOINT_URL=http://minio:9000 - S3_ACCESS_KEY=minioadmin