Jenkins/resources/com/cadoles/lighthouse/run-audit.sh

29 lines
643 B
Bash
Raw Normal View History

#!/bin/sh
set -x
envtpl -o config.js /home/lighthouse/config.js.tmpl
envtpl -o patty.json /home/lighthouse/patty.json.tmpl
mkdir -p reports
rm -f reports/*
cd reports
lighthouse \
--no-enable-error-reporting \
--chrome-flags="--headless --disable-dev-shm-usage --no-sandbox --disable-gpu" \
--config=../config.js \
--output json --output html \
--output-path=lighthouse \
-- \
"$LIGHTHOUSE_URL"
export PUPPETEER_EXECUTABLE_PATH=$(which chromium-browser)
pa11y --reporter html \
--config ../patty.json \
--include-warnings \
--include-notices \
"$LIGHTHOUSE_URL" > pa11y.report.html || exit 0