-
Notifications
You must be signed in to change notification settings - Fork 44
/
gitlab-pipeline-template.yml
54 lines (53 loc) · 2.38 KB
/
gitlab-pipeline-template.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
variables:
# DOCKER_IMAGE: <GitLab URL>/<username>/<project name>:latest
DOCKER_IMAGE: <GitLab URL>/<username>/<project name>:latest
# OOBEE_SCAN_URL: https://www.example.com
OOBEE_SCAN_URL: 'https://example.com'
# OOBEE_SCAN_TYPE: [choices: "sitemap", "website", "intelligent"]
OOBEE_SCAN_TYPE: 'website'
# OOBEE_SCAN_DEVICE: "Desktop"
# A full list of devices is available at https://github.com/GovTechSG/oobee#mobile-device-options
OOBEE_SCAN_DEVICE: 'Desktop'
# OOBEE_SCAN_MAX_NUM_PAGES: 100
OOBEE_SCAN_MAX_NUM_PAGES: 200
# OOBEE_MAX_CONCURRENT_PAGES: 25
# If scan encounters blocked pages / error 403, reduce to 1
OOBEE_MAX_CONCURRENT_PAGES: 1
# Speed up tests by excluding screenshots
# OOBEE_INCLUDE_SCREENSHOTS: [choices: "screenshots", "none"]
OOBEE_INCLUDE_SCREENSHOTS: 'none'
# Safe Mode to prevent unexpected dynamic page behaviours
# OOBEE_SCAN_SAFE_MODE: [choices: "yes", "no"]
OOBEE_SCAN_SAFE_MODE: 'yes'
# OOBEE_SCAN_ARTIFACT_NAME: "oobee-scan-results.zip"
OOBEE_SCAN_ARTIFACT_NAME: 'oobee-scan-results.zip'
# OOBEE_SCAN_NAME_EMAIL: "John Doe:[email protected]"
OOBEE_SCAN_NAME_EMAIL: ''
oobee-scan:
stage: test
tags:
# - some tag
image:
name: $DOCKER_IMAGE
entrypoint: ['/bin/bash', '-lc']
script:
# Start in the app dir
- cd /app
# Run accessibility scan
- OOBEE_VERBOSE=true npm run build && npm run cli -- -b chromium -c "$OOBEE_SCAN_TYPE" -d "$OOBEE_SCAN_DEVICE" -o "$CI_PROJECT_DIR/$OOBEE_SCAN_ARTIFACT_NAME" -u "$OOBEE_SCAN_URL" -p "$OOBEE_SCAN_MAX_NUM_PAGES" -a "$OOBEE_INCLUDE_SCREENSHOTS" -f "$OOBEE_SCAN_SAFE_MODE" -k "$OOBEE_SCAN_NAME_EMAIL" || true
# Move the results directory to artifacts
- results_directory=$(find results -mindepth 1 -maxdepth 1 -type d -print -quit) # Get the first directory within ./results
- if [ -n "$results_directory" ]; then mv "$results_directory" "$CI_PROJECT_DIR/artifacts"; fi # Move the directory to ./artifacts
artifacts:
paths:
# Stores the report CSV, HTML, summary PDF only to save storage space
- artifacts/report.csv
- artifacts/report.html
- artifacts/scanDetails.csv
- artifacts/summary.pdf
# Include screenhots folder
# - artifacts/elemScreenshots/
# Stores the reports folder so it can be accessed through Browse
# - artifacts/
# Uploads the results as zipped file
# - $OOBEE_SCAN_ARTIFACT_NAME