Reputation: 313
Say, I want to set some environment variables that are used in all jobs.
How do I do that in a sane way?
Upvotes: 7
Views: 7225
Reputation: 313
It's possible to use before and after script. The nice thing about it is you can overload it for a job if needed https://docs.gitlab.com/ee/ci/yaml/#before_script-and-after_script
Upvotes: 1
Reputation: 311228
You could add a top-level variables
section to your .gitlab-ci.yml
file:
variables:
MY_VAR: "some_value"
Upvotes: 2