Maven / GitLab CI Basics Interview Questions
What are stages in GitLab CI/CD and how do you define them?
Stages control the order of execution in a pipeline. Jobs within the same stage run in parallel; stages themselves run sequentially. If any job in a stage fails, subsequent stages are not run (unless configured otherwise).
# Define stages at the top level of .gitlab-ci.yml stages: - build - test - deploy # Jobs reference their stage with the "stage" keyword build-job: stage: build script: - echo "Building..." test-unit: stage: test script: - echo "Running unit tests..." test-integration: stage: test # also in "test" stage - runs PARALLEL to test-unit script: - echo "Running integration tests..." deploy-job: stage: deploy script: - echo "Deploying..."
Default stages: GitLab provides default stages if you do not define a stages block. The built-in defaults are: .pre, build, test, deploy, .post. The special .pre stage always runs first (before any other stages) and .post always runs last.
| Stage | Behaviour |
|---|---|
| .pre | Always runs before all other stages - regardless of stages list order |
| .post | Always runs after all other stages |
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...
