title: Using Gitlab Variables in Gitlab README.md for SonarQube Badges
body: <p>I'm using Gitlab and Sonarqube and the <a href="http://www.sonarplugins.com/status" rel="noreferrer">Sonarqube Plugin SVG Badges</a>.<br>
  To represent the Sonarqube state on gitlab I have something like this in my <code>README.md</code> file:</p>
  
  <pre><code>[![coverage](https://sonar.domain.com/api/badges/measure?key=com.domain:projectname&amp;metric=coverage)](https://sonar.domain.com/component_measures/metric/coverage/list?id=de.domain:projectname)
  </code></pre>
  
  <p>This works perfect. My badge is shown, the link is working, everything is fine.</p>
  
  <p>Is there some way to build something like:</p>
  
  <pre><code>[![coverage](https://sonar.domain.com/api/badges/measure?key={MYDOMAIN}:{THIS}&amp;metric=coverage)](https://sonar.domain.com/component_measures/metric/coverage/list?id={MYDOMAIN}:{THIS})
  </code></pre>
  
  <p>I want to provide a skeleton that every Developer just can copy and paste into their <code>README.md</code> file and the variables are filled into the README automatically, with something like <code>.gitlab-ci.yml</code></p>
  
  <p>I also tried the permanent Gitlab Variables <a href="https://gitlab.com/help/ci/variables/README.md" rel="noreferrer">mentioned here</a> but that wasn't working too!</p>
  
  <pre><code> [![coverage](https://sonar.domain.com/api/badges/measure?key=com.mydomain:$CI_PROJECT_NAME&amp;metric=coverage)](https://sonar.domain.com/component_measures/metric/coverage/list?id={MYDOMAIN}:$CI_PROJECT_NAME)
  </code></pre>
  
  <p>Anyone has some idea?</p>