I can't figure out how to pass in to Gitlab CI some env variables in a json file, specifically the one I use with cypress.io.
Gitlab CI certainly has a section where you can specify env vars in the form of a variable or a file.
However, Gitlab CI complains with "Variables key can contain only letters, digits and '_'".
So, things I have thought about:
- Overriding the env file that cypress uses by using the
--env
and then specifying a file like
# cypress-env
{
"username": "xxxx",
"password": "xxxx"
}
creating the file as specified in this answer https://stackoverflow.com/a/55581164/5597960
Asking Cypress.io team to include an example on how to do this (their excellent documentation does not have a similar example).
Researching more about specifying file variables in Gitlab CI. There is something strange about the error Gitlab produces. Why would they not allow dots in the file variable? I must be doing something wrong.