docs/current_docs/adopting/triggers/gitlab.mdx
GitLab CI runs dagger check inside your existing pipeline, so the same checks you run locally run on every push — without rewriting your .gitlab-ci.yml.
:::tip
For checks with no pipeline YAML at all, enable Cloud Checks with dagger ws autocheck on. The GitLab CI configuration below is the hybrid-mode alternative for when you want to drive Dagger from your existing GitLab CI setup.
:::
When running your Dagger checks with GitLab CI, the general workflow looks like this:
.gitlab-ci.yml file.dagger check against the modules installed in your workspace.DAGGER_CLOUD_TOKEN environment variable is set..dagger/config.toml) — see Workspace Setup.The following example demonstrates how to run dagger check in a GitLab CI/CD pipeline using the (default) Docker Machine executor or the Docker executor. In both these cases, the Dagger Engine is provisioned "just in time" using a Docker-in-Docker (dind) service.
dagger check runs all checks from the modules installed in your workspace and exits non-zero if any fail. To scope the run to a single module's checks, pass a pattern — for example dagger check go:*.
The following example demonstrates how to run dagger check in a GitLab CI/CD pipeline using the Kubernetes executor.
Each GitLab Runner must be configured to only run on nodes with pre-provisioned instances of the Dagger Engine. This is achieved using taints and tolerations on the nodes, and pod affinity.
The following code listings illustrate the configuration to be applied to each GitLab Runner, with taints, tolerations and pod affinity set via the dagger-node key. For an example of the corresponding node configuration, refer to the OpenShift integration page.
To use this configuration, replace the YOUR-GITLAB-URL placeholder with the URL of your GitLab instance and replace the YOUR-GITLAB-RUNNER-TOKEN-REFERENCE placeholder with your GitLab Runner authentication token.
By default the CLI starts a Dagger Engine inside the GitLab runner. For a faster, more reliable experience, offload execution to a managed Dagger Engine provided by Dagger Cloud by adding --cloud to the command:
dagger check --cloud
Cloud Engines provide a large persistent cache shared across runs and far more compute than a GitLab runner, so checks are typically much faster — and you don't provision or maintain any infrastructure. This requires the DAGGER_CLOUD_TOKEN variable configured above.
If you have any questions about additional ways to use GitLab with Dagger, join our Discord and ask your questions in our GitLab channel.
GitLab is a popular Web-based platform used for version control and collaboration. It allows developers to store and manage their code in repositories, track changes over time, and collaborate with other developers on projects.