From 47d53e9c874b9794b22f7d352fa25321b6694ecc Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 20 Feb 2025 07:58:55 +0100 Subject: [PATCH] ci: refs #6695 update Jenkinsfile remove unnecessary environment variables --- Jenkinsfile | 4 ++-- test/cypress/Dockerfile | 14 +++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index dceafaa4e..90f1bb5e1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -92,7 +92,6 @@ pipeline { environment { NODE_ENV = "" CREDENTIALS = credentials('docker-registry') - CYPRESS_CACHE = "${WORKSPACE}/.cypress-cache" } steps { script { @@ -108,8 +107,9 @@ pipeline { -e TZ=Europe/Madrid -e DOCKER=true -e CI=true - -v $CYPRESS_CACHE:/home/node/.cache/Cypress \ + -e CYPRESS_CACHE_FOLDER=/root/.cache/Cypress """.stripIndent()) { + sh 'ls -la /root/.cache/Cypress' // Verificar que el binario está disponible sh 'pnpm exec cypress run --browser chromium' } } diff --git a/test/cypress/Dockerfile b/test/cypress/Dockerfile index 7b0078fa3..3c75d701b 100644 --- a/test/cypress/Dockerfile +++ b/test/cypress/Dockerfile @@ -3,12 +3,16 @@ FROM alexmorenovn/vndev:latest WORKDIR /app COPY package.json pnpm-lock.yaml ./ -# Instalamos dependencias y descargamos Cypress +# Instalamos las dependencias y descargamos Cypress RUN pnpm install --frozen-lockfile \ - && CYPRESS_CACHE_FOLDER=/home/node/.cache/Cypress pnpm exec cypress install + && CYPRESS_CACHE_FOLDER=/root/.cache/Cypress pnpm exec cypress install -# Nos aseguramos de que el binario esté en PATH -ENV CYPRESS_CACHE_FOLDER=/home/node/.cache/Cypress -ENV PATH="${CYPRESS_CACHE_FOLDER}/13.17.0/Cypress:${PATH}" +# Movemos la caché de Cypress al directorio raíz para evitar problemas de permisos +RUN mkdir -p /root/.cache/Cypress \ + && cp -r /home/node/.cache/Cypress/* /root/.cache/Cypress/ + +# Configuramos variables de entorno +ENV CYPRESS_CACHE_FOLDER=/root/.cache/Cypress +ENV PATH="/root/.cache/Cypress/${CYPRESS_VERSION}/Cypress:${PATH}" WORKDIR /app