Skip to content

Commit

Permalink
jenkinsfile for accessability-audit
Browse files Browse the repository at this point in the history
  • Loading branch information
TomWoodward committed Sep 14, 2018
1 parent b4f2286 commit 1d3efa5
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 21 deletions.
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@ COPY . /code
WORKDIR /code
RUN yarn && yarn build tutor

FROM build as ui-testing

RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list

RUN apt-get update && apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg \
google-chrome-stable \
&& rm -rf /var/lib/apt/lists/*

FROM nginx as serve

COPY --from=build /code/tutor/dist/. /usr/share/nginx/html
Expand Down
20 changes: 0 additions & 20 deletions cd.jenkins

This file was deleted.

40 changes: 40 additions & 0 deletions jenkins/continuous-delivery.jenkins
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
pipeline {
agent { label 'docker' }
stages {
stage('Parallel') {
parallel {
stage('Accessibility Report') {
stages {
stage('Build Environment') {
steps {
sh "docker build --target=ui-testing -t openstax/tutor-js:ui-testing ."
}
}
stage('Run Audit') {
steps {
sh 'docker run -v $(pwd):/code -v /code/node_modules openstax/tutor-js:ui-testing node tutor/scripts/accessibility-audit --json=accessibility-report.json'
archiveArtifacts artifacts: 'accessibility-report.json', fingerprint: true
}
}
}
}
stage('Docker') {
stages {
stage('Build') {
steps {
sh "docker build -t openstax/tutor-js:dev --build-arg PUBLIC_PATH='https://tutor-assets.sandbox.openstax.org/' ."
}
}
stage('Push') {
steps {
withDockerRegistry([credentialsId: 'docker-registry', url: '']) {
sh "docker push openstax/tutor-js:dev"
}
}
}
}
}
}
}
}
}
2 changes: 1 addition & 1 deletion tutor/scripts/accessibility-audit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const urls = [
'/course/6',
];

const chromeFlags = ['--headless'];
const chromeFlags = ['--headless', '--no-sandbox'];
const onlyCategories = ['accessibility'];

const server = new TestServer({role: 'teacher'});
Expand Down

0 comments on commit 1d3efa5

Please sign in to comment.