// Kuality Quality Gate — Jenkins Pipeline Template // // Credentials (Manage Jenkins → Credentials): // KUALITY_API_KEY — your Kuality API key (Secret text, from Organization → API Keys) // // Environment variables (pipeline parameters or Jenkins config): // STAGING_URL — e.g. https://staging.yoursite.com // SCAN_TYPES — scan type to run (default: web) pipeline { agent any environment { KUALITY_API_KEY = credentials('kuality-api-key') } parameters { string(name: 'STAGING_URL', defaultValue: '', description: 'URL to scan') string(name: 'SCAN_TYPES', defaultValue: 'web', description: 'Scan type (a11y, seo, webvitals, headers, ...)') } stages { stage('Install Kuality CLI') { steps { sh ''' ARCH=$(uname -m) case "$ARCH" in x86_64) ARCH="amd64" ;; aarch64) ARCH="arm64" ;; esac curl -fsSL "https://github.com/kuality-io/cli/releases/latest/download/kuality_latest_linux_${ARCH}.tar.gz" -o kuality.tar.gz tar xzf kuality.tar.gz chmod +x kuality ''' } } stage('Kuality Scan') { steps { sh './kuality scan "${STAGING_URL}" --type "${SCAN_TYPES}" --fail-on high --format junit > kuality-report.xml' } post { always { junit testResults: 'kuality-report.xml', allowEmptyResults: true } } } } }