|
| 1 | +# sonar-scala-docker |
| 2 | +[](https://github.com/mwz/sonarqube-scala-docker/releases) |
| 3 | +[-v{{ltsVersion}}-blue.svg)](https://github.com/mwz/sonarqube-scala-docker/releases) |
| 4 | +[](https://hub.docker.com/r/mwizner/sonarqube-scala-plugins) |
| 5 | + |
| 6 | +Docker images and docker-compose recipes for out-of-the-box [SonarQube 6.7 LTS](https://www.sonarqube.org/sonarqube-6-7-lts) and [SonarQube 7.4](https://www.sonarqube.org/sonarqube-7-4) instance with support for [Scala](http://www.scala-lang.org), [Scoverage](https://github.com/scoverage/scalac-scoverage-plugin) (code coverage metrics) and [Scalastyle](http://www.scalastyle.org) + [Scapegoat](https://github.com/sksamuel/scapegoat) (static code analysis). :sunglasses: |
| 7 | + |
| 8 | + |
| 9 | +## Usage |
| 10 | +To start SonarQube in a daemon mode, simply run: |
| 11 | + |
| 12 | +```bash |
| 13 | +docker-compose up -d |
| 14 | +``` |
| 15 | + |
| 16 | +Once docker pulls all the required images and starts up the containers, the application should become available on [http://localhost](http://localhost). The default SonarQube login details for the Administrator account are `admin:admin`. |
| 17 | + |
| 18 | +You can also use a standalone docker image which contains SonarQube with bundled sonar-scala plugin, [`mwizner/sonarqube-scala-plugins:{{version}}-full`](https://hub.docker.com/r/mwizner/sonarqube-scala-plugins). |
| 19 | + |
| 20 | +To start the container issue the following command: |
| 21 | +```bash |
| 22 | +docker run -d \ |
| 23 | + --name sonarqube-scala-plugins-full \ |
| 24 | + -p 80:9000 \ |
| 25 | + -e SONARQUBE_JDBC_USERNAME=sonar \ |
| 26 | + -e SONARQUBE_JDBC_PASSWORD=sonar \ |
| 27 | + -e SONARQUBE_JDBC_URL=jdbc:postgresql://localhost/sonar \ |
| 28 | + mwizner/sonarqube-scala-plugins:{{version}}-full |
| 29 | +``` |
| 30 | +Please note that if you don't specify the `SONARQUBE_JDBC_URL` variable, SonarQube will use an embedded H2 database, which is not recommended in production, but if you don't have access to an existing database or you just want to try the image, you can use the following command: |
| 31 | +```bash |
| 32 | +docker run -d \ |
| 33 | + --name sonarqube-scala-plugins-full \ |
| 34 | + -p 80:9000 \ |
| 35 | + mwizner/sonarqube-scala-plugins:{{version}}-full |
| 36 | +``` |
| 37 | + |
| 38 | + |
| 39 | +## Dependencies |
| 40 | + * [SonarQube 6.7 LTS](https://hub.docker.com/_/sonarqube) / [SonarQube 7.4](https://hub.docker.com/_/sonarqube) |
| 41 | + * [PostgreSQL 10](https://hub.docker.com/_/postgres) |
| 42 | + * [mwz/sonar-scala](https://github.com/mwz/sonar-scala) - provides support for scalastyle, scoverage and scapegoat |
| 43 | + * versions before `2.7.0` used [arthepsy/sonar-scala-extra](https://github.com/arthepsy/sonar-scala-extra) for scapegoat support |
| 44 | + |
| 45 | + |
| 46 | +## Compatibility Matrix |
| 47 | +Version | SonarQube | sonar-scala | sonar-scala-extra |
| 48 | +--------|-----------|-------------|------------------ |
| 49 | +[3.2.1](https://github.com/mwz/sonarqube-scala-docker/releases/tag/3.2.1) | 7.4 ([documentation](https://docs.sonarqube.org/7.4/)) ([changelog](https://jira.sonarsource.com/jira/secure/ReleaseNote.jspa?projectId=10930&version=14549)) | [7.2.0](https://github.com/mwz/sonar-scala/releases/tag/v7.2.0) | |
| 50 | +[3.2.0](https://github.com/mwz/sonarqube-scala-docker/releases/tag/3.2.0) | 7.4 ([documentation](https://docs.sonarqube.org/7.4/)) ([changelog](https://jira.sonarsource.com/jira/secure/ReleaseNote.jspa?projectId=10930&version=14549)) | [7.2.0](https://github.com/mwz/sonar-scala/releases/tag/v7.2.0) | |
| 51 | +[3.1.0](https://github.com/mwz/sonarqube-scala-docker/releases/tag/3.1.0) | 7.4 ([documentation](https://docs.sonarqube.org/7.4/)) ([changelog](https://jira.sonarsource.com/jira/secure/ReleaseNote.jspa?projectId=10930&version=14549)) | [7.1.0](https://github.com/mwz/sonar-scala/releases/tag/v7.1.0) | |
| 52 | +[3.0.0](https://github.com/mwz/sonarqube-scala-docker/releases/tag/3.0.0) | 7.3 ([documentation](https://docs.sonarqube.org/display/SONARQUBE73/Documentation)) ([changelog](https://jira.sonarsource.com/jira/secure/ReleaseNote.jspa?projectId=10930&version=14464)) | [7.0.0](https://github.com/mwz/sonar-scala/releases/tag/v7.0.0) | |
| 53 | +[2.10.0](https://github.com/mwz/sonarqube-scala-docker/releases/tag/2.10.0) | 6.7.6 LTS ([documentation](https://docs.sonarqube.org/display/SONARQUBE67/Documentation)) ([changelog](https://jira.sonarsource.com/jira/secure/ReleaseNote.jspa?projectId=10930&version=13972)) | [6.7.0](https://github.com/mwz/sonar-scala/releases/tag/v6.7.0) | |
| 54 | +[2.9.0](https://github.com/mwz/sonarqube-scala-docker/releases/tag/2.9.0) | 6.7.5 LTS ([documentation](https://docs.sonarqube.org/display/SONARQUBE67/Documentation)) ([changelog](https://jira.sonarsource.com/jira/secure/ReleaseNote.jspa?projectId=10930&version=14467)) | [6.6.0](https://github.com/mwz/sonar-scala/releases/tag/v6.6.0) | |
| 55 | +[2.8.0](https://github.com/mwz/sonarqube-scala-docker/releases/tag/2.8.0) | 6.7.5 LTS ([documentation](https://docs.sonarqube.org/display/SONARQUBE67/Documentation)) ([changelog](https://jira.sonarsource.com/jira/secure/ReleaseNote.jspa?projectId=10930&version=14467)) | [6.5.1](https://github.com/mwz/sonar-scala/releases/tag/v6.5.1) | |
| 56 | +[2.7.0](https://github.com/mwz/sonarqube-scala-docker/releases/tag/2.7.0) | 6.7.4 LTS ([documentation](https://docs.sonarqube.org/display/SONARQUBE67/Documentation)) ([changelog](https://jira.sonarsource.com/jira/secure/ReleaseNote.jspa?projectId=10930&version=14377)) | [6.5.0](https://github.com/mwz/sonar-scala/releases/tag/v6.5.0) | |
| 57 | +[2.6.0](https://github.com/mwz/sonarqube-scala-docker/releases/tag/2.6.0) | 6.7.4 LTS ([documentation](https://docs.sonarqube.org/display/SONARQUBE67/Documentation)) ([changelog](https://jira.sonarsource.com/jira/secure/ReleaseNote.jspa?projectId=10930&version=14377)) | [6.4.0](https://github.com/mwz/sonar-scala/releases/tag/v6.4.0) | [1.3.0](https://github.com/arthepsy/sonar-scala-extra/releases/tag/v1.3.0) |
| 58 | +[2.5.0](https://github.com/mwz/sonarqube-scala-docker/releases/tag/2.5.0) | 6.7.3 LTS ([documentation](https://docs.sonarqube.org/display/SONARQUBE67/Documentation)) ([changelog](https://jira.sonarsource.com/jira/secure/ReleaseNote.jspa?projectId=10930&version=14264)) | [6.4.0](https://github.com/mwz/sonar-scala/releases/tag/v6.4.0) | [1.3.0](https://github.com/arthepsy/sonar-scala-extra/releases/tag/v1.3.0) |
| 59 | +[2.4.0](https://github.com/mwz/sonarqube-scala-docker/releases/tag/2.4.0) | 6.7.3 LTS ([documentation](https://docs.sonarqube.org/display/SONARQUBE67/Documentation)) ([changelog](https://jira.sonarsource.com/jira/secure/ReleaseNote.jspa?projectId=10930&version=14264)) | [6.3.0](https://github.com/mwz/sonar-scala/releases/tag/v6.3.0) | [1.3.0](https://github.com/arthepsy/sonar-scala-extra/releases/tag/v1.3.0) |
| 60 | +[2.3.0](https://github.com/mwz/sonarqube-scala-docker/releases/tag/2.3.0) | 6.7.3 LTS ([documentation](https://docs.sonarqube.org/display/SONARQUBE67/Documentation)) ([changelog](https://jira.sonarsource.com/jira/secure/ReleaseNote.jspa?projectId=10930&version=14264)) | [6.2.0](https://github.com/mwz/sonar-scala/releases/tag/v6.2.0) | [1.3.0](https://github.com/arthepsy/sonar-scala-extra/releases/tag/v1.3.0) |
| 61 | +[2.2.1](https://github.com/mwz/sonarqube-scala-docker/releases/tag/2.2.1) | 6.7.3 LTS ([documentation](https://docs.sonarqube.org/display/SONARQUBE67/Documentation)) ([changelog](https://jira.sonarsource.com/jira/secure/ReleaseNote.jspa?projectId=10930&version=14264)) | [6.1.0](https://github.com/mwz/sonar-scala/releases/tag/v6.1.0) | [1.3.0](https://github.com/arthepsy/sonar-scala-extra/releases/tag/v1.3.0) |
| 62 | +[2.2.0](https://github.com/mwz/sonarqube-scala-docker/releases/tag/2.2.0) | 6.7.2 LTS ([documentation](https://docs.sonarqube.org/display/SONARQUBE67/Documentation)) ([changelog](https://jira.sonarsource.com/jira/secure/ReleaseNote.jspa?projectId=10930&version=14191)) | [6.1.0](https://github.com/mwz/sonar-scala/releases/tag/v6.1.0) | [1.3.0](https://github.com/arthepsy/sonar-scala-extra/releases/tag/v1.3.0) |
| 63 | +[2.1.0](https://github.com/mwz/sonarqube-scala-docker/releases/tag/2.1.0), [2.0.0](https://github.com/mwz/sonarqube-scala-docker/releases/tag/2.0.0) | 6.7.1 LTS ([documentation](https://docs.sonarqube.org/display/SONARQUBE67/Documentation)) ([changelog](https://jira.sonarsource.com/jira/secure/ReleaseNote.jspa?projectId=10930&version=14137)) | [6.0.0](https://github.com/mwz/sonar-scala/releases/tag/v6.0.0) | [1.3.0](https://github.com/arthepsy/sonar-scala-extra/releases/tag/v1.3.0) |
| 64 | +[1.0.0](https://github.com/mwz/sonarqube-scala-docker/releases/tag/1.0.0) | 5.6.7 LTS ([documentation](https://docs.sonarqube.org/display/SONARQUBE56/Documentation)) | [0.0.3](https://github.com/Sagacify/sonar-scala/releases/tag/v0.0.3) | [1.3.0](https://github.com/arthepsy/sonar-scala-extra/releases/tag/v1.3.0) |
| 65 | + |
| 66 | +Please note, that starting from version `2.7.0`, the images no longer contain the [sonar-scala-extra](https://github.com/arthepsy/sonar-scala-extra) plugin as sonar-scala provides Scapegoat support from version `6.5.0` onwards. |
| 67 | + |
| 68 | +## Recommendations |
| 69 | +[sbt-sonar](https://github.com/mwz/sbt-sonar) is an sbt plugin which provides a way to automate analysis of Scala projects with SonarQube. |
| 70 | + |
| 71 | + |
| 72 | +## Changelog |
| 73 | +- **3.2.1** - Fixed file system permissions. |
| 74 | +- **3.2.0** - Upgraded sonar-scala to 7.2.0. |
| 75 | +- **3.1.0** - Upgraded sonar-scala to 7.1.0 & SonarQube to 7.4. |
| 76 | +- **3.0.0** - Upgraded sonar-scala to 7.0.0 & SonarQube to 7.3. |
| 77 | +- **2.10.0** - Upgraded sonar-scala to 6.7.0 & SonarQube to 6.7.6. |
| 78 | +- **2.9.0** - Upgraded sonar-scala to 6.6.0. |
| 79 | +- **2.8.0** - Upgraded sonar-scala to 6.5.1 & SonarQube to 6.7.5. |
| 80 | +- **2.7.0** - Upgraded sonar-scala to 6.5.0, which brings support for scapegoat. |
| 81 | +- **2.6.0** - Upgraded SonarQube to 6.7.4. |
| 82 | +- **2.5.0** - Upgraded sonar-scala to 6.4.0. |
| 83 | +- **2.4.0** - Upgraded sonar-scala to 6.3.0. |
| 84 | +- **2.3.0** - Upgraded sonar-scala to 6.2.0. |
| 85 | +- **2.2.1** - Upgraded SonarQube to 6.7.3 LTS. |
| 86 | +- **2.2.0** - Upgraded sonar-scala to 6.1.0 & SonarQube to 6.7.2 LTS. |
| 87 | +- **2.1.0** - Published docker image with Scala plugins to dockerhub [mwizner/sonarqube-scala-plugins](https://hub.docker.com/r/mwizner/sonarqube-scala-plugins). |
| 88 | +- **2.0.0** - SonarQube 6.7.1 LTS. |
| 89 | +- **1.0.0** - SonarQube 5.6.7 LTS. |
| 90 | + |
| 91 | + |
| 92 | +## License |
| 93 | +The project is licensed under the Apache License v2. See the [LICENSE file](LICENSE) for more details. |
0 commit comments