Skip to content

Latest commit

 

History

History
58 lines (41 loc) · 2.29 KB

cicd_gitlab.md

File metadata and controls

58 lines (41 loc) · 2.29 KB

Gitlab CI/CD pipelines

Location cicd/gitlab

Some Gitlab based CI/CD helper pipelines

Description

Setup

  1. Import your GitHub project from GitLab. See this Gitlab documentation.

  2. Enable "Require status checks to pass before merging"? in "Settings"/"Branch protection rules" section for the "main" branch.

  3. Get repo

  4. 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).

  5. 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

  6. Enable runners [General pipelines] expand [Runners] expand Pick "Shared runners"

  7. 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

A few notes on style

  • 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 . and extends keyword (see extends description