predefined CI/CD variables
Variables GitLab sets in every job, such as CI_COMMIT_BRANCH, CI_COMMIT_SHA and CI_REGISTRY_IMAGE, describing the pipeline, the commit and the project.
In more detail
Some exist only in certain pipelines: CI_COMMIT_BRANCH is absent in tag and merge request pipelines, and CI_MERGE_REQUEST_IID exists only in merge request pipelines. Rules, scripts and keywords such as image can all use them.
Related terms
- pipeline source — The predefined variable CI_PIPELINE_SOURCE, which says what created a pipeline, such as push, merge_request_event, schedule or web.
- CI/CD job token — A short-lived token GitLab creates for each job, in CI_JOB_TOKEN, that lets the job call GitLab's API, registries and package registries.
Taught in
- The Merge Request That Deployed To Production — GitLab Certified CI/CD Associate Exam Prep
- From Push To Runner: How GitLab Starts A Pipeline — GitLab Certified CI/CD Associate Exam Prep
- Jobs And Stages: Who Waits, Who Runs, Who Gets Skipped — GitLab Certified CI/CD Associate Exam Prep
- Rules, Workflow Rules And The Legacy only And except — GitLab Certified CI/CD Associate Exam Prep
- Reuse With extends And include, And What Survives The Merge — GitLab Certified CI/CD Associate Exam Prep
- Caching: Dependencies That Survive Between Pipelines — GitLab Certified CI/CD Associate Exam Prep
- CI/CD Variables: Where Values Come From, And Which One Wins — GitLab Certified CI/CD Associate Exam Prep
- Environments, Review Apps And Deployments — GitLab Certified CI/CD Associate Exam Prep
- The Container Registry: Build, Tag, Push, Clean Up — GitLab Certified CI/CD Associate Exam Prep
- Package Registries: Publishing With The Job Token — GitLab Certified CI/CD Associate Exam Prep
- Adding GitLab's Security Scanners To A Pipeline — GitLab Certified CI/CD Associate Exam Prep
- Debugging Pipelines: The Graph, The Errors, The Logs — GitLab Certified CI/CD Associate Exam Prep
- Faster Pipelines: Minutes You Can Win Back — GitLab Certified CI/CD Associate Exam Prep
- Recall Sprint: Knowing It Cold, With No Docs And No AI — GitLab Certified CI/CD Associate Exam Prep
- Final Mock And Review: One Question Short — GitLab Certified CI/CD Associate Exam Prep