Librairie d'audit d'accessibilité

This commit is contained in:
2020-08-10 15:15:32 +02:00
parent 7f2ef25102
commit f3e5f7b9ef
4 changed files with 24 additions and 6 deletions

View File

@ -1,7 +1,25 @@
def audit(url: String) {
def audit(String url, Map params = [:]) {
def reporter = params.reporter ? params.reporter : 'html'
def pa11yImage = buildDockerImage()
def dockerArgs = """
-e PA11Y_REPORTER='${reporter}'
-e PA11Y_URL='${url}'
"""
pa11yImage.inside(dockerArgs) {
sh 'chown -R pa11y: ./'
def report = sh(
script: 'su pa11y - /usr/local/bin/run-audit',
returnStdout: true
)
return report
}
}
def buildDockerImage() {
dir ('.pa11y') {
def resourceFiles = [