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

32 lines
818 B
Bash

#!/bin/bash
envtpl -o patty.json /home/pa11y/patty.json.tmpl
mkdir -p reports
rm -f reports/*
cd reports
export PUPPETEER_EXECUTABLE_PATH=$(which chromium-browser)
export PA11Y_REPORTER="${PA11Y_REPORTER:-html}"
export PA11Y_STANDARD="${PA11Y_STANDARD:-WCAG2AA}"
export PA11Y_IGNORE="${PA11Y_IGNORE:-'WCAG2AA.Principle1.Guideline1_4.1_4_3.G18.Fail;WCAG2AA.Principle1.Guideline1_4.1_4_3.G145.Fail'}"
PA11Y_ARGS=""
if [ "${PA11Y_INCLUDE_WARNINGS}" == 'true' ]; then
PA11Y_ARGS="${PA11Y_ARGS} --include-warnings"
fi
if [ "${PA11Y_INCLUDE_NOTICES}" == 'true' ]; then
PA11Y_ARGS="${PA11Y_ARGS} --include-notices"
fi
pa11y \
--config ../patty.json \
${PA11Y_ARGS} \
--reporter "${PA11Y_REPORTER}" \
--standard "${PA11Y_STANDARD}" \
--ignore "${PA11Y_IGNORE}" \
"$PA11Y_URL" || exit 0