CI/CD
Jenkins
Set up a Jenkins pipeline for CodeAnt CI scan.
Jenkins Pipeline Configuration
Below is a Declarative Pipeline example. It fetches the CodeAnt scan helper script and runs a security/quality scan on every build:
Tip:
- In Manage Jenkins → Credentials, add a Secret text credential containing your token, and reference its ID under
credentials(...)
.- Jenkins automatically provides
$GIT_COMMIT
(the current commit SHA) when you use the Git plugin.- You can also set
REPO_NAME = env.GIT_URL.split(‘/’)[-2..-1].join(‘/’)
in ascript {}
block if you’d rather infer it dynamically.
How It Works
-
Checkout Pulls the branch you configured for the job.
-
Download script
curl
grabsstart_scan.sh
from the CodeAnt CI endpoint. -
Execute scan The helper posts your repo slug, commit SHA, include/exclude globs, and token to
/analysis/ci/scan
. -
Build result
- On HTTP errors, the step fails (non-zero exit), marking the build as failed.
- On success, you’ll see the JSON response in the console log for diagnostics.
With this pipeline, every Jenkins build will automatically trigger a CodeAnt analysis scan.