Compare commits
4 Commits
pa11y-audi
...
build_pipe
Author | SHA1 | Date | |
---|---|---|---|
b458d075fe | |||
fba9a12cb4 | |||
cd8525c8b1 | |||
407fe87318 |
82
pipelines/mse-rgaa.jenkinsfile
Normal file
82
pipelines/mse-rgaa.jenkinsfile
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
import hudson.tasks.test.AbstractTestResultAction
|
||||||
|
|
||||||
|
@Library("cadoles") _
|
||||||
|
|
||||||
|
pipeline {
|
||||||
|
|
||||||
|
parameters {
|
||||||
|
text(name: 'URLS', defaultValue: 'https://msedev.crous-toulouse.fr\nhttps://msedev.crous-toulouse.fr/envole/enregistrement\nhttps://msedev.crous-toulouse.fr/envole/page/faq\nhttps://msedev.crous-toulouse.fr/envole/page/?t=liens_utiles\nhttps://msedev.crous-toulouse.fr/envole/page/?t=mentions_legales\nhttps://msedev.crous-toulouse.fr/envole/message/new\nhttps://msedev.crous-toulouse.fr/envole/recuperation/email\nhttps://msedev.crous-toulouse.fr/envole/courriel/raz', description: 'Liste des URLs à tester, une par ligne')
|
||||||
|
string(name: 'USERNAME', defaultValue: '', description: "Nom d'utilisateur pour l'authentification Basic Auth, si nécessaire")
|
||||||
|
password(name: 'PASSWORD', defaultValue: '', description: "Mot de passe pour l'authentification Basic Auth, si nécessaire")
|
||||||
|
booleanParam(name: 'INCLUDE_WARNINGS', defaultValue: false, description: 'Inclure les avertissements')
|
||||||
|
booleanParam(name: 'INCLUDE_NOTICES', defaultValue: false, description: 'Inclure les notifications')
|
||||||
|
}
|
||||||
|
|
||||||
|
options {
|
||||||
|
disableConcurrentBuilds()
|
||||||
|
}
|
||||||
|
|
||||||
|
agent {
|
||||||
|
node {
|
||||||
|
label "mse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stages {
|
||||||
|
stage("Run RGAA audit") {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
def urls = params.URLS.split('\n')
|
||||||
|
|
||||||
|
def count = 0
|
||||||
|
urls.each { u ->
|
||||||
|
stage("Audit page '${u}'") {
|
||||||
|
def report = pa11y.audit(u.trim(), [
|
||||||
|
reporter: 'junit',
|
||||||
|
username: params.USERNAME,
|
||||||
|
password: params.PASSWORD,
|
||||||
|
standard: 'WCAG2AA',
|
||||||
|
includeNotices: params.INCLUDE_NOTICES,
|
||||||
|
includeWarnings: params.INCLUDE_WARNINGS,
|
||||||
|
]);
|
||||||
|
|
||||||
|
writeFile file:"./report_${count}.xml", text:report
|
||||||
|
count++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
junit "*.xml"
|
||||||
|
|
||||||
|
rocketSend (
|
||||||
|
channel: "#cnous-mse-dev",
|
||||||
|
avatar: 'https://jenkins.cadol.es/static/b5f67753/images/headshot.png',
|
||||||
|
message: """
|
||||||
|
Audit RGAA | ${testStatuses()}
|
||||||
|
|
||||||
|
- [Voir les tests](${env.RUN_DISPLAY_URL})
|
||||||
|
|
||||||
|
@here
|
||||||
|
""".stripIndent(),
|
||||||
|
rawMessage: true,
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonCPS
|
||||||
|
def testStatuses() {
|
||||||
|
def testStatus = ""
|
||||||
|
AbstractTestResultAction testResultAction = currentBuild.rawBuild.getAction(AbstractTestResultAction.class)
|
||||||
|
if (testResultAction != null) {
|
||||||
|
def total = testResultAction.totalCount
|
||||||
|
def failed = testResultAction.failCount
|
||||||
|
def skipped = testResultAction.skipCount
|
||||||
|
def passed = total - failed - skipped
|
||||||
|
testStatus = "Passant(s): ${passed}, Échoué(s): ${failed} ${testResultAction.failureDiffString}, Désactivé(s): ${skipped}"
|
||||||
|
}
|
||||||
|
return testStatus
|
||||||
|
}
|
@ -5,7 +5,7 @@ ARG HTTPS_PROXY=
|
|||||||
ARG http_proxy=
|
ARG http_proxy=
|
||||||
ARG https_proxy=
|
ARG https_proxy=
|
||||||
|
|
||||||
ARG TAMARIN_VERSION=develop
|
ARG TAMARIN_VERSION=253c774
|
||||||
|
|
||||||
RUN apk add --no-cache git docker python3 bash
|
RUN apk add --no-cache git docker python3 bash
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ def call() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage("Run Lighthouse and pa11y audits") {
|
stage("Run Lighthouse audit") {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
def lighthouseImage = buildDockerImage()
|
def lighthouseImage = buildDockerImage()
|
||||||
@ -66,10 +66,9 @@ def call() {
|
|||||||
rocketSend (
|
rocketSend (
|
||||||
avatar: 'https://jenkins.cadol.es/static/b5f67753/images/headshot.png',
|
avatar: 'https://jenkins.cadol.es/static/b5f67753/images/headshot.png',
|
||||||
message: """
|
message: """
|
||||||
Les audits pour `${params.url}` sont terminés:
|
L'audit Lighthouse pour `${params.url}` est terminé:
|
||||||
|
|
||||||
- [Voir le rapport Lighthouse (bonnes pratiques)](${env.BUILD_URL}Rapports_20d_27audit/lighthouse.report.html)
|
- [Voir le rapport](${env.BUILD_URL}Rapports_20d_27audit/lighthouse.report.html)
|
||||||
- [Voir le rapport pa11y (accessibilité)](${env.BUILD_URL}Rapports_20d_27audit/pa11y.report.html)
|
|
||||||
|
|
||||||
[Lancer un nouvel audit](${env.BUILD_URL}../build)
|
[Lancer un nouvel audit](${env.BUILD_URL}../build)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user