How is a GitLab CI pipeline defined and structured?
⚡
Quick Answer
In .gitlab-ci.yml, as jobs grouped into stages that run sequentially; jobs in the same stage run in parallel.
Detailed Answer
Each job declares a stage, a script, and optional rules/needs. Stages run in order (build -> test -> deploy) and jobs within a stage run in parallel. needs: creates a DAG so a job can start before its whole stage finishes, speeding pipelines.
Code Example
stages: [build, test] build: stage: build script: [make]
💡
Interview Tip
Mention needs: to build a DAG instead of strict stages.
gitlab-cipipelinestages