Skip to content

GitLab CI

erode analyzes GitLab merge requests using the same Docker image published for the GitHub Action.

The image includes entrypoint-gitlab.sh, which handles model cloning and MR URL construction automatically:

erode:
image: ghcr.io/erode-app/core:latest
entrypoint: ['/entrypoint-gitlab.sh']
rules:
- if: $CI_MERGE_REQUEST_IID
variables:
GITLAB_TOKEN: $GITLAB_API_TOKEN
ANTHROPIC_API_KEY: $ANTHROPIC_API_KEY
LIKEC4_MODEL_REPO: 'group/architecture-model'
VariableRequiredDefaultDescription
GITLAB_TOKENYesGitLab API token with api scope
GEMINI_API_KEY, OPENAI_API_KEY, or ANTHROPIC_API_KEYYesAI provider API key
AI_PROVIDERNoanthropicgemini, openai, or anthropic
LIKEC4_MODEL_REPONoModel repository path (e.g. group/architecture-model). Omit if the model is in the same repo
LIKEC4_MODEL_PATHNo.Path to model within the repository
LIKEC4_MODEL_REFNomainGit ref for the model repository
LIKEC4_MODEL_REPO_TOKENNo$GITLAB_TOKENSeparate token for model repository access
LIKEC4_OPEN_PRNofalseCreate MR with suggested model updates
LIKEC4_FAIL_ON_VIOLATIONSNofalseExit with code 1 when violations are found
LIKEC4_SKIP_FILE_FILTERINGNofalseAnalyze all changed files
GITLAB_BASE_URLNohttps://gitlab.comFor self-hosted GitLab instances

If you prefer more control, disable the default entrypoint and call the CLI:

erode:
image: ghcr.io/erode-app/core:latest
entrypoint: ['']
script:
- >
node /app/packages/core/dist/ci-entry.js analyze ./model
--url "$CI_PROJECT_URL/-/merge_requests/$CI_MERGE_REQUEST_IID"
--format json --comment --fail-on-violations
rules:
- if: $CI_MERGE_REQUEST_IID
variables:
GITLAB_TOKEN: $GITLAB_API_TOKEN
ANTHROPIC_API_KEY: $ANTHROPIC_API_KEY
erode:
image: ghcr.io/erode-app/core:latest
entrypoint: ['']
script:
- git clone --depth 1 "https://gitlab-ci-token:${GITLAB_TOKEN}@gitlab.com/group/architecture-model.git" /tmp/model
- >
node /app/packages/core/dist/ci-entry.js analyze /tmp/model
--url "$CI_PROJECT_URL/-/merge_requests/$CI_MERGE_REQUEST_IID"
--format json --comment
rules:
- if: $CI_MERGE_REQUEST_IID
variables:
GITLAB_TOKEN: $GITLAB_API_TOKEN
ANTHROPIC_API_KEY: $ANTHROPIC_API_KEY

Set GITLAB_BASE_URL to point at your instance:

variables:
GITLAB_BASE_URL: https://gitlab.example.com

Platform detection identifies github.com and gitlab.com from PR/MR URLs. Self-hosted GitLab instances require GITLAB_BASE_URL and the full MR URL passed via --url.

See Configuration for all environment variables and Self-Hosted for other deployment options.