Maven / 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.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
