Skip to content

GitLab Concepts

GitLab CI/CD runs pipelines from .gitlab-ci.yml files committed to the repository.

Core Ideas

  • Pipelines are composed of stages.
  • Stages contain jobs.
  • Jobs run on runners.
  • Runners can be shared or project-specific.

Typical Pipeline Flow

  1. Lint code.
  2. Run tests.
  3. Build artifacts or container images.
  4. Deploy to a target environment.

Example

stages:
  - test
  - deploy

test:
  stage: test
  script:
    - npm ci
    - npm test

deploy:
  stage: deploy
  script:
    - ./deploy.sh
  only:
    - main

Practical Notes

  • Keep the pipeline short and visible.
  • Use artifacts for build outputs.
  • Store secrets in protected CI variables, not in the repo.