DevOps / Gitlab Interview questions
What is a.gitlab-ci.yml file?
The .gitlab-ci.yml file is the YAML configuration file, placed at the root of a repository, that tells GitLab how to run a project's CI/CD pipeline. GitLab automatically looks for this file on every push and, if present, kicks off a pipeline based on what it defines.
A minimal example defining two stages looks like this:
stages: - build - test build-job: stage: build script: - echo "Building the app" - npm install test-job: stage: test script: - npm test
Each top-level key that isn't a reserved keyword (like stages, variables, or image) becomes a job. The job's script section lists the shell commands a runner executes, and stage assigns it to a position in the pipeline's overall order.
More Related questions...