Librairie d'audit d'accessibilité
This commit is contained in:
@ -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 = [
|
||||
|
Reference in New Issue
Block a user