
GitLab CI/CD
.gitlab-ci.yml, stages, jobs, runners, artifacts, cache, environments, deployments, troubleshooting pipelines
1What is the name of the configuration file to define GitLab CI/CD pipelines?
What is the name of the configuration file to define GitLab CI/CD pipelines?
回答
.gitlab-ci.yml file located at the repository root defines all pipelines, stages, jobs and CI/CD configurations. GitLab automatically detects this file and executes pipelines on every push or merge request. The YAML format provides declarative syntax for defining pipeline infrastructure as code.
2What does a 'stage' represent in GitLab CI/CD?
What does a 'stage' represent in GitLab CI/CD?
回答
A stage is a logical pipeline phase that groups multiple jobs executed in parallel. Stages run sequentially in the defined order (e.g., build → test → deploy). Jobs within the same stage can run in parallel if multiple runners are available. If a job fails in a stage, the pipeline stops by default.
3What is the main difference between 'artifacts' and 'cache' in GitLab CI?
What is the main difference between 'artifacts' and 'cache' in GitLab CI?
回答
Artifacts are files generated by a job and passed to subsequent jobs or downloadable (e.g., compiled binaries, test reports). Cache stores dependencies to speed up builds (e.g., node_modules, .m2). Artifacts are guaranteed between jobs, cache is best-effort. Cache uses a key for sharing between pipelines, artifacts are per-pipeline.
Which keyword controls when a job executes in GitLab CI?
What is a GitLab Runner?
+19 面接問題