From 952c75127abfcc3782ff79f25cbf4a08a593f032 Mon Sep 17 00:00:00 2001 From: Lucas Date: Mon, 12 Jan 2026 12:25:35 +0100 Subject: [PATCH] fix(lighthouse): change audit export path and config --- .lighthouserc.cjs | 3 ++- Jenkinsfile | 11 +++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.lighthouserc.cjs b/.lighthouserc.cjs index 015a3fa..396880f 100644 --- a/.lighthouserc.cjs +++ b/.lighthouserc.cjs @@ -16,7 +16,8 @@ module.exports = { }, }, upload: { - target: 'temporary-public-storage', + target: 'filesystem', + outputDir: './.lighthouseci', // C'est ici que Jenkins ira chercher les fichiers }, }, }; \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index 2c07463..fecf9c6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -18,13 +18,16 @@ pipeline { } stage('Lighthouse Audit') { steps { - // Create volumes but no run + + // Create volumes but no run with safety + sh "docker rm -f audit-tmp lighthouse-audit || true" sh "docker compose --profile audit create lighthouse-audit" // Extract astro data from image to tmp-dist sh "docker create --name audit-tmp portfolio:${env.APP_VERSION}" sh "mkdir -p ./tmp-dist" sh "docker cp audit-tmp:/usr/share/caddy/. ./tmp-dist" + sh "docker rm -f audit-tmp" // Inject data from tmp-dist and config to audit container sh "docker cp ./tmp-dist/. lighthouse-audit:/app/dist/" @@ -37,8 +40,8 @@ pipeline { sh "mkdir -p ./.lighthouseci" sh "docker cp lighthouse-audit:/app/.lighthouseci/. ./.lighthouseci/" - // Clean temp - sh "docker rm lighthouse-audit" + // Clean + sh "docker rm -f lighthouse-audit" sh "rm -rf ./tmp-dist" } } @@ -68,7 +71,7 @@ pipeline { alwaysLinkToLastBuild: true, keepAll: false, reportDir: '.lighthouseci', - reportFiles: 'index.html', + reportFiles: '*.html', reportName: 'Lighthouse Report' ]) echo "Clean unused image"