CI/CD
GitLab
Set up GitLab CI workflow for CodeAnt CI scan.
GitLab CI/CD Configuration
Add the following to your .gitlab-ci.yml
. This single job will download the scan helper script and trigger a CodeAnt analysis on each push:
Tip:
- In Settings → CI/CD → Variables, add a protected and masked variable named
ACCESS_TOKEN
with your repo- or project-level PAT.- GitLab provides
$CI_PROJECT_PATH
(e.g.group/project
) and$CI_COMMIT_SHA
automatically.
How It Works
-
Fetch script We
curl
thestart_scan.sh
helper from the CodeAnt CI endpoint. -
Enable execution
chmod +x start_scan.sh
makes it runnable. -
Trigger scan The script posts your project path, commit SHA, file-globs, and token to
/analysis/ci/scan
. -
Pipeline feedback
- Exits non-zero on HTTP errors, failing the job.
- Prints the JSON response on success so you can record scan IDs or logs.
With this in place, every push through GitLab CI/CD will automatically launch a CodeAnt security/quality scan.