Some checks failed
Portfolio/pipeline/head There was a failure building this commit
28 lines
758 B
Bash
Executable File
28 lines
758 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Clean old audits and containers
|
|
rm -rf ./.lighthouseci
|
|
docker rm -f lighthouse-audit || true
|
|
|
|
# Load env file and avoid warning for unused portofolio version
|
|
if [ -f .env.dist ]; then
|
|
export $(grep -v '^#' .env.dist | xargs)
|
|
fi
|
|
export PORTFOLIO_VERSION="local-audit"
|
|
|
|
# Create container but no start
|
|
docker compose --profile audit create --no-build --remove-orphans lighthouse-audit
|
|
|
|
# Inject data and config to container
|
|
docker cp ./dist/. lighthouse-audit:/app/dist/
|
|
docker cp .lighthouserc.cjs lighthouse-audit:/app/dist/audit-config.cjs
|
|
|
|
# Now run
|
|
docker start -a lighthouse-audit
|
|
|
|
# Get reports
|
|
mkdir -p ./.lighthouseci
|
|
docker cp lighthouse-audit:/app/.lighthouseci/. ./.lighthouseci/
|
|
|
|
# Clean container
|
|
docker rm -f lighthouse-audit |