title: Write GitLab CI variables to file
body: <p>How could I write GitLab CI variables to config file like this:</p>
  <pre><code>test:
    stage: test
    script:
      - touch &quot;config.json&quot;
      - echo &quot;{&quot;database&quot;:&quot;$DB_NAME&quot;}&quot; &gt;&gt; config.json
  </code></pre>
  <p>The variables couldn't be resolved. Always I get the following json in file <code>config.json</code>: <code>{&quot;database&quot;:&quot;$DB_NAME&quot;}</code> but I want this <code>{&quot;database&quot;:&quot;my_database_name&quot;}</code></p>
  <p>How could I solve this problem?</p>