Gitlab CI/CD pipelines
Location cicd/gitlab
Some Gitlab based CI/CD helper pipelines
-
Import your GitHub project from GitLab. See this Gitlab documentation.
-
Enable "Require status checks to pass before merging"? in "Settings"/"Branch protection rules" section for the "main" branch.
-
Get repo
-
Create (if you need) cicd/gitlab folders, add configs. We use cicd/gitlab/dot.gitlab-ci.yml for this repo instead the default one (see below).
-
Edit settings for CI/CD [General pipelines] expand Set "CI/CD configuration file" to cicd/gitlab/dot.gitlab-ci.yml Click [Save changes] at the end of this small section
-
Enable runners [General pipelines] expand [Runners] expand Pick "Shared runners"
-
Customize email settings Like it's stated on the official documentation:
- Go to Settings > Integrations > Pipeline status emails.
- Edit Recipients (a comma-separated list of email addresses)
- Select Notify only broken pipelines
- Select the branches
- Save
-
We suggest separating logic for running various parts into separate pipelines and using different
trigger
jobs to invoke these pipelines. As for now we have cicd/gitlab/parts/ folder for these needs. -
Feel free to use external pipelines (as
trigger
jobs) or other parts from GitLab templates. Though for pipelines, please, add
trigger:
...
forward:
pipeline_variables: false
yaml_variables: false
...
to your trigger jobs whenever possible.
-
We're trying to use
:
decided "namespace" qualifiers for stage and job names. -
Feel free to use template/generic jobs with names starting from
.
andextends
keyword (seeextends
description