DevOps / GitLab CI Basics Interview Questions
What are pipeline triggers and how can a pipeline be started without a git push?
GitLab pipelines can be triggered by multiple mechanisms beyond a git push. Understanding all trigger sources allows you to design flexible CI/CD workflows.
| Source | Value | How triggered |
|---|---|---|
| Git push | push | Developer pushes commits to any branch |
| Merge request | merge_request_event | MR is created or updated |
| Web UI | web | 'Run pipeline' button in GitLab UI |
| API | api | POST to /api/v4/projects/:id/pipeline |
| Trigger token | trigger | POST with a pipeline trigger token |
| Schedule | schedule | Scheduled pipeline ran |
| Parent pipeline | parent_pipeline | Upstream pipeline triggered this child |
| Chat | chat | GitLab ChatOps slash command |
# Trigger a pipeline via API: curl --request POST \ --form "token=<trigger-token>" \ --form "ref=main" \ --form "variables[DEPLOY_ENV]=staging" \ "https://gitlab.example.com/api/v4/projects/123/trigger/pipeline" # Trigger a downstream pipeline from a job (bridge job): trigger-deploy: stage: deploy trigger: project: myorg/deploy-repo branch: main strategy: depend # wait for downstream pipeline to complete # Check trigger source in rules: job-for-mr-only: rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event"
Pipeline triggers can pass custom variables, enabling flexible parameterised pipelines. For example, you can trigger a deployment pipeline from another system, passing the environment name and image tag as variables.
More Related questions...