fix(jenkins): fix lighthouse audit launch in jenkinsfile
All checks were successful
Portfolio/pipeline/head This commit looks good

This commit is contained in:
2026-01-12 16:56:40 +01:00
parent 2e86857b61
commit 883362f496

8
Jenkinsfile vendored
View File

@@ -21,9 +21,9 @@ pipeline {
// Create volumes but no run with safety // Create volumes but no run with safety
sh "docker rm -f audit-tmp lighthouse-audit || true" sh "docker rm -f audit-tmp lighthouse-audit || true"
sh "docker compose --profile audit create lighthouse-audit" sh "docker compose --profile audit create --no-build --remove-orphans lighthouse-audit"
// Extract astro data from image to tmp-dist // Extract astro data from temp container to tmp-dist folder
sh "docker create --name audit-tmp portfolio:${env.APP_VERSION}" sh "docker create --name audit-tmp portfolio:${env.APP_VERSION}"
sh "mkdir -p ./tmp-dist" sh "mkdir -p ./tmp-dist"
sh "docker cp audit-tmp:/usr/share/caddy/. ./tmp-dist" sh "docker cp audit-tmp:/usr/share/caddy/. ./tmp-dist"
@@ -32,9 +32,10 @@ pipeline {
// Inject data from tmp-dist and config to audit container // Inject data from tmp-dist and config to audit container
sh "docker cp ./tmp-dist/. lighthouse-audit:/app/dist/" sh "docker cp ./tmp-dist/. lighthouse-audit:/app/dist/"
sh "docker cp .lighthouserc.cjs lighthouse-audit:/app/dist/audit-config.cjs" sh "docker cp .lighthouserc.cjs lighthouse-audit:/app/dist/audit-config.cjs"
sh "rm -rf ./tmp-dist"
// Now run // Now run
sh "docker compose --profile audit run lighthouse-audit" sh "docker start -a lighthouse-audit"
// Get reports // Get reports
sh "mkdir -p ./.lighthouseci" sh "mkdir -p ./.lighthouseci"
@@ -42,7 +43,6 @@ pipeline {
// Clean // Clean
sh "docker rm -f lighthouse-audit" sh "docker rm -f lighthouse-audit"
sh "rm -rf ./tmp-dist"
} }
} }
stage('Deploy') { stage('Deploy') {