DevOps / GitLab CI Basics Interview Questions
What is a GitLab CI/CD pipeline?
A pipeline is the top-level component of GitLab CI/CD. It is a complete automated workflow that runs when triggered by an event (such as a git push). A pipeline consists of one or more stages, each containing one or more jobs.
| Level | Component | Description |
|---|---|---|
| 1 (top) | Pipeline | The complete automated workflow triggered by an event |
| 2 | Stage | A group of jobs that run in parallel; stages run sequentially |
| 3 (bottom) | Job | The individual unit of work - runs scripts on a runner |
Pipeline lifecycle:
- A pipeline is created when a triggering event occurs (push, merge request, schedule, API call, etc.)
- Jobs are assigned to available runners which execute them
- The pipeline passes if all jobs succeed, fails if any job fails
- Results and logs are visible under Build > Pipelines in the GitLab UI
# A pipeline with 3 stages: # Stage 1 (build): runs first # Stage 2 (test): runs after build passes # Stage 3 (deploy): runs after test passes stages: - build - test - deploy build-app: stage: build script: make build unit-tests: stage: test script: make test deploy-staging: stage: deploy script: make deploy
More Related questions...