Provides a docker infrastructure to execute Sonar without changing any configuration of the project
SonarBox is only a docker infrastructure to analyze our projects in a non-invasive and effortless way. It provides the SonarQube server, a persistent Database for our analysis and a scanner to perform the analysis.
The only thing you need to perform the analysis is docker and docker-compose
Until I upload the scanner to docker registry, you'll need to build the scanner image the first time you run the project. Doing it, is as simple as Running
$ docker-compose build
You'll get a standard SonarQube installation. However you'll possibly want to configure it and add install some plugins before performing the analysis. The only thing you need to do is starting the server by executing:
$ docker-compose up sonar
If you want to install pluigns just follow this instructions:
- Once the server is running you can open http://localhost:9000 and log into Sonar with admin/admin credentials.
- Then navigate to Administration
- Go to System > Update Center
- In available tab you'll find every plugin you need.
The plugins will be stored into sonar-extensions folder so you'll only need to do this the first time.
Before analyzing the project you'll have to create a sonar-project.properties file for your project type. You'll find some examples in the templates folder.
TBD
Once you have your configuration file, analyzing the source should be as simple as
$ export PROJECT_TO_ANALIZE=/path/to/your/source/code
$ export SONAR_PROJECT_PROPERITES=/path/to/your/project/properies/file
$ docker-compose up scanner