title: How to pass a predefined json env variable to a gitlab job?
body: <p>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.</p>
  <p>Gitlab CI certainly has a section where you can specify env vars in the form of a variable or a file.</p>
  <p><a href="https://i.stack.imgur.com/Wx0tZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Wx0tZ.png" alt="enter image description here" /></a></p>
  <p>However, Gitlab CI complains with &quot;Variables key can contain only letters, digits and '_'&quot;.</p>
  <p>So, things I have thought about:</p>
  <ol>
  <li>Overriding the env file that cypress uses by using the <code>--env</code> and then specifying a file like</li>
  </ol>
  <pre><code># cypress-env
  {
    &quot;username&quot;: &quot;xxxx&quot;,
    &quot;password&quot;: &quot;xxxx&quot;
  }
  </code></pre>
  <ol start="2">
  <li><p>creating the file as specified in this answer <a href="https://stackoverflow.com/a/55581164/5597960">https://stackoverflow.com/a/55581164/5597960</a></p>
  </li>
  <li><p>Asking Cypress.io team to include an example on how to do this (their excellent documentation does not have a similar example).</p>
  </li>
  <li><p>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.</p>
  </li>
  </ol>