Skip to content

Pipelines

damdit-cli ci audit runs one audit of an address without a project. Give it the report of the previous run as a baseline and it compares the two; the step fails only when an issue is new or came back.

  1. Store your CI key as a secret of the pipeline and pass it as DAMDIT_CI_KEY. See Add your CI key.
  2. Install Damdit CLI in the job. The runner needs Docker:
Terminal window
curl -fsSL https://download.damdit.com/cli/install.sh | sh
export PATH="$HOME/.local/bin:$PATH"
Terminal window
damdit-cli ci audit https://staging.example.com \
--baseline previous.dpk --out current.dpk \
--fail-on new,reappeared --fail-severity high \
--report client.pdf
  • --out saves this run’s report: .dpk, as the app saves audits, or .json. Keep it, for example as a pipeline artifact or in a cache, and give it as --baseline next time.
  • --baseline is the report of the run to compare with. On the first run there is none: leave out --baseline and --fail-on.
  • --fail-on is new, reappeared or both, and needs --baseline.
  • --fail-severity counts only issues of this severity or higher: critical, high, medium or low.
  • --report writes a report for people: client or developer, then a .pdf, .html or .md file, for example --report client:handover.pdf or --report developer:site.html. A file named client.pdf or developer.html needs no prefix: --report client.pdf. Give --report more than once for several reports.

Paths are relative to the current folder, which ci always sees. An --out file elsewhere works too: its folder is added for that run.

The log shows the score, the comparison (new, resolved, reappeared, inconclusive and still detected) and each issue that fails the step.

Option What it does
--pages N Audit at most this many pages
--urls URL,URL Audit only these pages. Can’t be combined with --pages or --baseline.
--format json The result as JSON on stdout; the readable summary goes to stderr
--language en-US The language pages are asked for
--webflow-site ID The Webflow site, with DAMDIT_WEBFLOW_TOKEN (or set DAMDIT_WEBFLOW_SITE)
--gsc-property sc-domain:example.com Search Console, with DAMDIT_GSC_CREDENTIALS (or set DAMDIT_GSC_PROPERTY)

Keys and passwords come from environment variables, never from options. An audit that runs longer than 60 minutes is stopped.

Code Meaning
0 The audit is done, and nothing failed it
1 The audit could not finish
2 An option is wrong, or the baseline can’t be read
6 The licence: no key, an invalid key, or no active licence
7 Nothing responds at the address
8 The website blocked Damdit, or the locked website’s access is missing
9 The audit is done and found what --fail-on asks to fail on

damdit-cli ci run audits every website listed in damdit.yml in the current folder, one after another, and compares each with its previous run. damdit-cli ci serve runs their schedules until you stop it.

state: ./damdit-state # where each site keeps its history, runs and reports
sites:
- name: Northwind
url: https://northwind.example
pages: 200
schedule: daily 03:00 # or "weekly mon 06:00", "monthly 1 03:00" (ci serve)
pageSpeed: true
reports: [client.pdf, developer.html]
failOn: [new, reappeared]
failSeverity: high
  • Keep the state folder between runs: it holds each site’s history, its latest runs and its reports.
  • --site NAME audits only that site; --config reads another file.
  • A site can also take language, webflow, searchConsole and access for a locked website. They name environment variables, never secrets, for example access: { kind: basic, usernameEnv: NORTHWIND_USER, passwordEnv: NORTHWIND_PASSWORD }.
  • ci run ends with 1 when an audit failed, 9 when a site found what its failOn asks to fail on, and 0 otherwise.

For a staging site behind a password or an access rule, set one kind of access:

Kind Variables
HTTP Basic DAMDIT_SITE_USERNAME and DAMDIT_SITE_PASSWORD
Vercel Deployment Protection DAMDIT_VERCEL_BYPASS
Cloudflare Access DAMDIT_CF_ACCESS_CLIENT_ID and DAMDIT_CF_ACCESS_CLIENT_SECRET
Webflow site password DAMDIT_WEBFLOW_PASSWORD

If the start page is locked and the access is missing or wrong, the audit ends with exit code 8 and names the variables to set.