I am working to set up a gitlab runner for multiple projects, and we want to be able to set up environment variables for all of the projects. I tried to set global variables in the .bashrc
for both the gitlab-runner
and root
users but it did not recognize them during the CI script. What is the correct location to declare global environment variables?
You can define environment variables to inject in the runner's config.toml
file. See the advanced runner configuration documentation in the [[runners]]
section.
There doesn't seem to be a way to specify environment variables in the GitLab UI just for a specific runner.