Variable precedence
Variable precedence
Variables con be defined on many different levels
GitLab has documented the precedence of variables
The order from lowest to highest precedence is:
- Predefined variables
- Deployment variables
- Global variables in
.gitlab-ci.yml
(including workflow rules)
- Job variables in
.gitlab-ci.yml
(after template and rule resolution)
- Variables from
dotenv
reports
- Instance variables
- Group variables
- Project variables
- Pipeline variables (more on next slide)
- Scan execution policy variables
- Pipeline execution policy variables
More about pipeline variables
Variables that are passed when starting a pipeline
They have the same precedence:
- Manual job variables
- Creating a pipeline trough the API
- Manual pipeline run
- Scheduled pipeline variables
- Trigger variables
- Variables passed downstream
Only one is possible at a time