Configure SonarQube with code

Hi guys, I’m deploying SonarQube to our infrastructure and I’m wondering if it’s possible to export all the configuration we did (quality gates, profiles, etc) to files that we can by applied in boot time to sonar - as we do with plugins defining them in code.

This is usually a requirement for companies applying configuration as code for all their software.

Thanks!

Hi,

Welcome to the community!

The things you’ve mentioned are stored in the database so they’ll be applied at boot time automatically when SonarQube connects to the DB. There are some configurations in $SONARQUBE-HOME/conf/sonar.properties, so… I guess that’s already in the file format you’re looking for(?).

 
Not sure this helps…?
Ann

Hey @Fernando_Torres were you ever able to find out how to apply configuration as code? I want to be able to setup projects, tokens, other settings as configuration or code, similar to Jenkins “configuration as code” support. What did you end up going with?

Hey,

You may have a look at the sonar-config tool part of the sonar-tools python package.
Feedback is welcome.

Olivier

3 Likes