Skip to content

Latest commit

 

History

History
75 lines (55 loc) · 2.1 KB

README.md

File metadata and controls

75 lines (55 loc) · 2.1 KB

GitLab Utils

This repository holds several resources used by my other repositories on GitLab.

CI/CD Components

Reusable components for GitLab CI/CD pipelines.

  • sane-workflow - Prevent duplicated pipelines.
  • stages - Default stages used in all my projects.

How to use:

include:
  - component: gitlab.com/vaz-projects/gitlab/[email protected]

Conventions

All components in this repository use the following conventions.

  1. Include the stages component. Most other components depend on it.

    include:
      - component: gitlab.com/vaz-projects/gitlab/[email protected]
  2. Don't use stage directly. Use the provided base jobs instead. They properly define the rules for each stage (and have ✨pretty✨ names).

    job:
        extends: .buildStage
  3. When using extends and rules: Include a reference to the base job's rules. Otherwise, all other rules would be overwritten.

    job:
        extends: .baseJob
        
        rules:
          - $VAR == 'VALUE'
          - !reference [ .baseJob, rules ]

Deployment Styles

The stages component support two different deployment styles:

  1. Deploy on tag pipelines. Default branch is used pro development. Good for versioned releases.

    • feature-branch/without-mr: Build & Test
    • feature-branch/with-mr: Build & Test -> Deploy to review app
    • default-branch: Build & Test
    • tag: Build & Test -> Deploy to staging -> Deploy to production
  2. Deploy on default branch pipelines. Default branch is used for staging and production. Good for continuous delivery/deployment.

    • feature-branch/without-mr: Build & Test
    • feature-branch/with-mr: Build & Test -> Deploy to review app
    • default-branch: Build & Test -> Deploy to staging -> Deploy to production
    • tag: Build & Test
include:
    - component: gitlab.com/vaz-projects/gitlab/[email protected]
      inputs:
        deployOn: defaultBranch

GitLab Runners

TODO

Renovate Presets

TODO

GitLab Project Configuration as Code

TODO