Variables in review apps and deployments

How do you handle variables between multiple environments in GitLab?

We have a production (tagged), test (develop branch) and a number review environments. Our review environments can have the same configuration but test and production are different. We manage all settings in environment variables.

A setting can be the mail server. All three of the above environments would need a different setting.

Where would we store this? In the variables section in .gitlab-ci.yml?

For now we have solved this by hardcoding all variables in .gitlab-ci.yml for every stage. As we don’t store sensitive information in these variables that’s not a big deal.

This topic is quite old, but in case anyone else comes across it, the answer here is to create CI env vars in the UI and potentially to mask the variable.