GitLab CI is the continuous integration system integrated in GitLab that allows automating build, test, and deployment pipelines.

What is GitLab CI?

GitLab CI is a CI/CD tool that allows defining pipelines using .gitlab-ci.yml files to automate the software development process.

.gitlab-ci.yml File

Basic Pipeline

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
stages:
  - build
  - test
  - deploy

build:
  stage: build
  script:
    - echo "Building application"
    - npm install
    - npm run build
  artifacts:
    paths:
      - dist/

test:
  stage: test
  script:
    - echo "Running tests"
    - npm test
  coverage: '/Lines\s*:\s*(\d+\.\d+)%/'

deploy:
  stage: deploy
  script:
    - echo "Deploying application"
    - npm run deploy
  only:
    - main
  • GitLab - Platform that includes GitLab CI
  • Docker - Containers in pipelines
  • Kubernetes - Deployment in K8s
  • DevOps - Methodology it facilitates
  • SDLC - Automated lifecycle

References