Stages
Last updated
Stages define the order of the pipeline. We can think of stages as the flowchart of our pipeline. Let's assume we are writing a pipeline for a Maven project. The typical order for a Maven project (or any other software development project) is:
Build
Test
Deploy
Each above step is called a stage
in GitLab CI terminology and the tasks under the stages run sequentially.
We can have multiple Java versions to test our code against and it is efficient to run our tests in parallel.
The jobs under the same stage run in parallel and the job(s) in the next stage can only start if the previous stage is finished.
Let's also show how we can define the stages in .gitlab-ci.yml
file:
GitLab CI pipelines are mostly formed around software development. If you do not define any stages in your pipeline, the default pipeline stages are:
.pre
build
test
deploy
.post