Maven / GitLab CI Basics Interview Questions
What is the.gitlab-ci.yml file and where must it be placed?
The .gitlab-ci.yml file is the pipeline configuration file for GitLab CI/CD. It uses YAML syntax to define stages, jobs, scripts, rules, and all other pipeline behaviour. GitLab automatically detects and runs the pipeline whenever this file is present and a triggering event occurs.
Key facts:
- Must be placed at the root of the repository by default
- The filename is case-sensitive - it must be exactly
.gitlab-ci.yml - You can configure a different path/filename in Settings > CI/CD > General pipelines > CI/CD configuration file
- It is a regular file tracked by Git, so all changes are version-controlled and can be reviewed in merge requests
# Minimal .gitlab-ci.yml stages: - build - test - deploy build-job: stage: build script: - echo "Compiling the code..." - echo "Compile complete." test-job: stage: test script: - echo "Running tests..." deploy-job: stage: deploy script: - echo "Deploying to production..."
The CI Lint tool (available in the GitLab UI under CI/CD > Pipelines > CI Lint) validates your .gitlab-ci.yml syntax before you commit, helping you catch configuration errors early.
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...
