fix(lighthouse): change audit export path and config
This commit is contained in:
@@ -16,7 +16,8 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
upload: {
|
upload: {
|
||||||
target: 'temporary-public-storage',
|
target: 'filesystem',
|
||||||
|
outputDir: './.lighthouseci', // C'est ici que Jenkins ira chercher les fichiers
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
11
Jenkinsfile
vendored
11
Jenkinsfile
vendored
@@ -18,13 +18,16 @@ pipeline {
|
|||||||
}
|
}
|
||||||
stage('Lighthouse Audit') {
|
stage('Lighthouse Audit') {
|
||||||
steps {
|
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"
|
sh "docker compose --profile audit create lighthouse-audit"
|
||||||
|
|
||||||
// Extract astro data from image to tmp-dist
|
// Extract astro data from image to tmp-dist
|
||||||
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"
|
||||||
|
sh "docker rm -f audit-tmp"
|
||||||
|
|
||||||
// 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/"
|
||||||
@@ -37,8 +40,8 @@ pipeline {
|
|||||||
sh "mkdir -p ./.lighthouseci"
|
sh "mkdir -p ./.lighthouseci"
|
||||||
sh "docker cp lighthouse-audit:/app/.lighthouseci/. ./.lighthouseci/"
|
sh "docker cp lighthouse-audit:/app/.lighthouseci/. ./.lighthouseci/"
|
||||||
|
|
||||||
// Clean temp
|
// Clean
|
||||||
sh "docker rm lighthouse-audit"
|
sh "docker rm -f lighthouse-audit"
|
||||||
sh "rm -rf ./tmp-dist"
|
sh "rm -rf ./tmp-dist"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -68,7 +71,7 @@ pipeline {
|
|||||||
alwaysLinkToLastBuild: true,
|
alwaysLinkToLastBuild: true,
|
||||||
keepAll: false,
|
keepAll: false,
|
||||||
reportDir: '.lighthouseci',
|
reportDir: '.lighthouseci',
|
||||||
reportFiles: 'index.html',
|
reportFiles: '*.html',
|
||||||
reportName: 'Lighthouse Report'
|
reportName: 'Lighthouse Report'
|
||||||
])
|
])
|
||||||
echo "Clean unused image"
|
echo "Clean unused image"
|
||||||
|
|||||||
Reference in New Issue
Block a user