Gitlab Topvaz - =link=
build: extends: .test_template variables: LOG_LEVEL: "debug" # overrides top-level for this job RETRIES: 5 Use artifacts:reports:dotenv to pass variables between jobs – this is the most underrated GitLab feature:
debug: script: env | sort | Want to... | Do this | |-------------------------------------|----------------------------------------------| | Set a default for all jobs | variables: at top of .gitlab-ci.yml | | Override for one job | variables: inside the job | | Pass a computed value between jobs | dotenv artifact | | Hide a secret | UI project/group variable + masked: true | | Limit a var to protected branches | UI variable + protected: true | gitlab topvaz
variables: LOG_LEVEL: "info" RETRIES: 2 .test_template: script: - echo "Log level: $LOG_LEVEL" build: extends:
1. Top-level variables (The "Global Vault") Define variables at the root of .gitlab-ci.yml . These apply to all jobs unless overridden. These apply to all jobs unless overridden