Sobes.tech
Intern

How does working with GitLab look like? What is the difference between Stage and Job in GitLab CI?

sobes.tech AI

Answer from AI

In GitLab CI, the build and deploy process is divided into stages and jobs. A stage is a logical step in the pipeline, such as build, test, deploy. Jobs are specific tasks executed within a stage. All jobs of one stage run in parallel, and the next stage begins only after all jobs of the previous stage have successfully completed.

Example:

stages:
  - build
  - test

build_job:
  stage: build
  script:
    - make build

test_job:
  stage: test
  script:
    - make test

Here, build_job and test_job are jobs, and build and test are stages. Thus, a stage is a level of organization, and a job is a specific unit of work.