refacto(ci): local and jenkins Lighthouse audit use common docker compose service #3
8
Jenkinsfile
vendored
8
Jenkinsfile
vendored
@@ -21,9 +21,9 @@ pipeline {
|
||||
|
||||
// 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 --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 "mkdir -p ./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
|
||||
sh "docker cp ./tmp-dist/. lighthouse-audit:/app/dist/"
|
||||
sh "docker cp .lighthouserc.cjs lighthouse-audit:/app/dist/audit-config.cjs"
|
||||
sh "rm -rf ./tmp-dist"
|
||||
|
||||
// Now run
|
||||
sh "docker compose --profile audit run lighthouse-audit"
|
||||
sh "docker start -a lighthouse-audit"
|
||||
|
||||
// Get reports
|
||||
sh "mkdir -p ./.lighthouseci"
|
||||
@@ -42,7 +43,6 @@ pipeline {
|
||||
|
||||
// Clean
|
||||
sh "docker rm -f lighthouse-audit"
|
||||
sh "rm -rf ./tmp-dist"
|
||||
}
|
||||
}
|
||||
stage('Deploy') {
|
||||
|
||||
Reference in New Issue
Block a user