This guide integrates Vibgrate drift scanning into Travis CI. It is for teams still running .travis.yml builds who want a DriftScore on every commit.
Prerequisites
- A Travis CI account linked to your repository.
- The Node.js language environment.
Build configuration
language: node_js
node_js:
- '20'
script:
- npx @vibgrate/cli scan --fail-on error
Travis checks out your repository into the build directory, so npx @vibgrate/cli scan scans the project root.
Failing the build
--fail-on error returns a non-zero exit code when an error-severity finding is present, which Travis treats as a failed script phase. The Exit Codes reference documents the complete mapping for scripting.
Drift budget gate
To gate on the overall DriftScore instead of individual findings:
npx @vibgrate/cli scan --drift-budget 60
Producing a report
Write a Markdown report you can read from the build log or upload elsewhere:
npx @vibgrate/cli scan --format markdown --out drift-report.md
Travis does not have a first-class artifact store; upload the file to an external bucket in an after_script step if you need to retain it.
Caching
Add the Vibgrate cache directory to the Travis cache block to avoid cold scans:
cache:
directories:
- node_modules
Related
- Schedule nightly Vibgrate scans with Travis cron jobs.
- Push scan results to Vibgrate Cloud from CI for visibility.