The stage parameter

Stages are defined at the top level of the YAML file and are used to define separate blocks of jobs, which can be executed in parallel. They also define the order in which stages are run. In each job, the stage parameter can be used to define which build stage a job is in, thus grouping together similar jobs and allowing for jobs to depend on other jobs having finished. The following is an example of defining and using stages:

stages:  - build  - test  - deployjob 1:  stage: build  script: npm run build dependenciesjob 2:  stage: build  script: npm run build artifactsjob 3:  stage: test  script: npm run testjob 4:  stage: deploy  script: npm run deploy

In this case, we have defined three stages: build, test, and deploy. All of the ...

Get GitLab Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.