Maven / GitLab CI Basics Interview Questions
What are parent-child pipelines in GitLab CI/CD?
Parent-child pipelines (also called dynamic pipelines) allow a job in one pipeline (the parent) to dynamically generate and trigger another pipeline (the child). This enables modular, scalable pipelines for monorepos and complex projects.
# Parent pipeline (.gitlab-ci.yml): stages: - generate - trigger generate-child-config: stage: generate script: - generate-pipeline-config.sh > child-pipeline.yml # dynamic YAML artifacts: paths: - child-pipeline.yml trigger-child: stage: trigger trigger: include: - artifact: child-pipeline.yml job: generate-child-config strategy: depend # wait for child to complete # Or trigger from a static file: trigger-static-child: trigger: include: - local: ci/child-pipeline.yml strategy: depend # Child pipeline (ci/child-pipeline.yml): stages: - build - test build-child: stage: build script: echo "Child pipeline building..."
| Feature | Detail |
|---|---|
| strategy: depend | Parent pipeline status reflects child pipeline result |
| Dynamic config | Child YAML can be generated at runtime by the parent |
| Isolation | Child pipeline has its own stages, jobs, and variables |
| Artifacts | Child can receive artifacts from the parent job that triggered it |
| Depth limit | GitLab limits nesting to a certain depth (check current docs) |
Common monorepo use case: a parent pipeline detects which subdirectories changed, then triggers separate child pipelines for only those services - avoiding running every service's tests on every push.
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...
