fix(ci): pasar credenciales SITAR al backend del stack E2E
Sin SITAR_API_URL/USER/PASSWORD, el botón "Consultar DOF" del dialog ExchangeRateGuard nunca llena el input (el backend no tiene cómo pedir el TC) y auth.setup.ts:72 falla con timeout. En el E2E viejo no salía porque apuntaba a dev en vivo, donde ya había TC para hoy y el dialog ni se abría. Cambios: - docker-compose.e2e.yml: backend recibe SITAR_API_URL/USER/PASSWORD por env var passthrough con defaults vacíos. - Jenkinsfile: lee a76-sitar-api-url (string) y a76-sitar-credentials (usernamePassword) vía withCredentials y los inyecta. - Cleanup ahora dumpea las últimas 200 líneas del backend cuando el stack está arriba, para diagnosticar fallas opacas (auth, SITAR, migraciones, etc.) sin tener que repetir el build. Requiere en Jenkins: - a76-sitar-api-url (Secret Text) - a76-sitar-credentials (Username with password) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
14
Jenkinsfile
vendored
14
Jenkinsfile
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user