mirror of
https://gitlab.com/TECHNOFAB/nix-gitlab-ci.git
synced 2025-12-12 18:20:07 +01:00
31 lines
1.2 KiB
Markdown
31 lines
1.2 KiB
Markdown
# Multiple Pipelines
|
|
|
|
With V2, Nix GitLab CI can generate different pipelines, depending on the
|
|
pipeline source (`$CI_PIPELINE_SOURCE`).
|
|
|
|
By default, no matter which source, the `default` pipeline is built and ran.
|
|
`$NIX_CI_PIPELINE` can override that, eg. when manually triggering a run.
|
|
To configure which source should be 1-to-1 translated to a pipeline with the
|
|
same name, set `$NIX_CI_DEFAULT_SOURCES` to a regex which explicitly does not
|
|
match these sources. Or set it to an impossible to match regex, then it will
|
|
always run the pipeline named after `$CI_PIPELINE_SOURCE`.
|
|
|
|
## Example 1: always run default
|
|
|
|
If you only have a single pipeline, you just have to call it `default`.
|
|
Everything else works out of the box.
|
|
|
|
## Example 2: default and merge_request_event
|
|
|
|
If you want the source `merge_request_event` to trigger a different pipeline,
|
|
name it like that and set `$NIX_CI_DEFAULT_SOURCES` to `^(merge_request_event)$`.
|
|
Now a merge request will run this pipeline, while everything else runs `default`.
|
|
|
|
## Example 3: default, push and web
|
|
|
|
Set `$NIX_CI_DEFAULT_SOURCES` to `^(push|web)$`.
|
|
|
|
## Example 4: always run the specific pipelines, never default
|
|
|
|
Set `$NIX_CI_DEFAULT_SOURCES` to any regex that never matches the sources,
|
|
like `a\A` or `nothing`.
|