Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Upgrade sonar-scala to 7.0.0 & SonarQube to 7.3.
Browse files Browse the repository at this point in the history
  • Loading branch information
mwz committed Oct 9, 2018
1 parent dd56da7 commit 1f99f58
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 30 deletions.
12 changes: 12 additions & 0 deletions 3.0.0-full/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# SonarQube 7.3 image with bundled sonar-scala 7.0.0 (https://github.com/mwz/sonar-scala).

FROM mwizner/sonarqube:7.3-alpine

ENV SONAR_SCALA_VERSION 7.0.0

WORKDIR /opt/sonarqube/extensions/plugins
RUN wget -O "sonar-scala-plugin-${SONAR_SCALA_VERSION}.jar" \
"https://dl.bintray.com/mwz/maven/com/github/mwz/sonar-scala_2.12/${SONAR_SCALA_VERSION}/sonar-scala_2.12-${SONAR_SCALA_VERSION}-assembly.jar"

WORKDIR $SONARQUBE_HOME
ENTRYPOINT ["./bin/run.sh"]
12 changes: 12 additions & 0 deletions 3.0.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Alpine image with bundled sonar-scala 7.0.0 (https://github.com/mwz/sonar-scala),
# which can be mounted as a volume into a SonarQube container.

FROM alpine:3.7

ENV SONAR_SCALA_VERSION 7.0.0

RUN apk --no-cache add --repository http://dl-cdn.alpinelinux.org/alpine/v3.7/community wget ca-certificates

WORKDIR /opt/sonarqube/extensions/plugins
RUN wget -O "sonar-scala-plugin-${SONAR_SCALA_VERSION}.jar" \
"https://dl.bintray.com/mwz/maven/com/github/mwz/sonar-scala_2.12/${SONAR_SCALA_VERSION}/sonar-scala_2.12-${SONAR_SCALA_VERSION}-assembly.jar"
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![GitHub version](https://img.shields.io/github/tag/mwz/sonarqube-scala-docker.svg?label=release)](https://github.com/mwz/sonarqube-scala-docker/releases)
[![Docker Pulls](https://img.shields.io/docker/pulls/mwizner/sonarqube-scala-plugins.svg)](https://hub.docker.com/r/mwizner/sonarqube-scala-plugins)

A docker-compose recipe for out-of-the-box [SonarQube LTS](https://www.sonarqube.org) 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:
A docker-compose recipe for out-of-the-box [SonarQube 6.7 LTS](https://www.sonarqube.org/sonarqube-6-7-lts) and [SonarQube 7.3](https://www.sonarqube.org/sonarqube-7-3) 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:


## Usage
Expand All @@ -14,7 +14,7 @@ docker-compose up -d

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`.

You can also use a standalone docker image which contains SonarQube LTS with bundled Scala plugins [`mwizner/sonarqube-scala-plugins:2.9.0-full`](https://hub.docker.com/r/mwizner/sonarqube-scala-plugins).
You can also use a standalone docker image which contains SonarQube with bundled Scala plugins [`mwizner/sonarqube-scala-plugins:3.0.0-full`](https://hub.docker.com/r/mwizner/sonarqube-scala-plugins).

To start the container issue the following command:
```bash
Expand All @@ -23,13 +23,13 @@ docker run -d --name sonarqube-scala-plugins-full \
-e SONARQUBE_JDBC_USERNAME=sonar \
-e SONARQUBE_JDBC_PASSWORD=sonar \
-e SONARQUBE_JDBC_URL=jdbc:postgresql://localhost/sonar \
mwizner/sonarqube-scala-plugins:2.9.0-full
mwizner/sonarqube-scala-plugins:3.0.0-full
```
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.


## Dependencies
* [SonarQube 6.7 LTS](https://hub.docker.com/_/sonarqube)
* [SonarQube 6.7 LTS](https://hub.docker.com/_/sonarqube) / [SonarQube 7.3](https://hub.docker.com/r/mwizner/sonarqube/tags)
* [PostgreSQL 10](https://hub.docker.com/_/postgres)
* [mwz/sonar-scala](https://github.com/mwz/sonar-scala) - provides support for scalastyle, scoverage and scapegoat.
* versions before `2.7.0` used [arthepsy/sonar-scala-extra](https://github.com/arthepsy/sonar-scala-extra) for scapegoat support.
Expand All @@ -38,6 +38,7 @@ Please note that if you don't specify the `SONARQUBE_JDBC_URL` variable, SonarQu
## Compatibility Matrix
Version | SonarQube | sonar-scala | sonar-scala-extra
--------|-----------|-------------|------------------
[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) |
[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) |
[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) |
[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) |
Expand All @@ -57,6 +58,7 @@ Please note, that starting from version `2.7.0`, the images no longer contain th


## Changelog
- **3.0.0** - Upgraded sonar-scala to 7.0.0 & SonarQube to 7.3.
- **2.9.0** - Upgraded sonar-scala to 6.6.0.
- **2.8.0** - Upgraded sonar-scala to 6.5.1 & SonarQube to 6.7.5.
- **2.7.0** - Upgraded sonar-scala to 6.5.0, which brings support for scapegoat.
Expand Down
44 changes: 24 additions & 20 deletions README_DOCKERHUB.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
Docker images with out-of-the-box [SonarQube LTS](https://www.sonarqube.org) 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).
Docker images with out-of-the-box [SonarQube 6.7 LTS](https://www.sonarqube.org/sonarqube-6-7-lts) and [SonarQube 7.3](https://www.sonarqube.org/sonarqube-7-3) 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).


## Available versions
There are two types of images available: images with [sonar-scala](https://github.com/mwz/sonar-scala) plugin, which can be mounted as a volume into a SonarQube container and images which bundle sonar-scala plugin with SonarQube (suffixed with `-full`).

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.

- `2.9.0`, `latest` [Dockerfile](https://github.com/mwz/sonar-scala-docker/blob/master/2.9.0/Dockerfile), [(v2.9.0)](https://github.com/mwz/sonar-scala-docker/releases/tag/2.9.0)
- `3.0.0`, `latest` [Dockerfile](https://github.com/mwz/sonar-scala-docker/blob/master/3.0.0/Dockerfile), [(v3.0.0)](https://github.com/mwz/sonar-scala-docker/releases/tag/3.0.0)
- `3.0.0-full` [Dockerfile](https://github.com/mwz/sonar-scala-docker/blob/master/3.0.0-full/Dockerfile), [(v3.0.0)](https://github.com/mwz/sonar-scala-docker/releases/tag/3.0.0)
- `2.9.0` [Dockerfile](https://github.com/mwz/sonar-scala-docker/blob/master/2.9.0/Dockerfile), [(v2.9.0)](https://github.com/mwz/sonar-scala-docker/releases/tag/2.9.0)
- `2.9.0-full` [Dockerfile](https://github.com/mwz/sonar-scala-docker/blob/master/2.9.0-full/Dockerfile), [(v2.9.0)](https://github.com/mwz/sonar-scala-docker/releases/tag/2.9.0)
- `2.8.0`, `latest` [Dockerfile](https://github.com/mwz/sonar-scala-docker/blob/master/2.8.0/Dockerfile), [(v2.8.0)](https://github.com/mwz/sonar-scala-docker/releases/tag/2.8.0)
- `2.8.0` [Dockerfile](https://github.com/mwz/sonar-scala-docker/blob/master/2.8.0/Dockerfile), [(v2.8.0)](https://github.com/mwz/sonar-scala-docker/releases/tag/2.8.0)
- `2.8.0-full` [Dockerfile](https://github.com/mwz/sonar-scala-docker/blob/master/2.8.0-full/Dockerfile), [(v2.8.0)](https://github.com/mwz/sonar-scala-docker/releases/tag/2.8.0)
- `2.7.0`, `latest` [Dockerfile](https://github.com/mwz/sonar-scala-docker/blob/master/2.7.0/Dockerfile), [(v2.7.0)](https://github.com/mwz/sonar-scala-docker/releases/tag/2.7.0)
- `2.7.0` [Dockerfile](https://github.com/mwz/sonar-scala-docker/blob/master/2.7.0/Dockerfile), [(v2.7.0)](https://github.com/mwz/sonar-scala-docker/releases/tag/2.7.0)
- `2.7.0-full` [Dockerfile](https://github.com/mwz/sonar-scala-docker/blob/master/2.7.0-full/Dockerfile), [(v2.7.0)](https://github.com/mwz/sonar-scala-docker/releases/tag/2.7.0)
- `2.6.0` [Dockerfile](https://github.com/mwz/sonar-scala-docker/blob/master/2.6.0/Dockerfile), [(v2.6.0)](https://github.com/mwz/sonar-scala-docker/releases/tag/2.6.0)
- `2.6.0-full` [Dockerfile](https://github.com/mwz/sonar-scala-docker/blob/master/2.6.0-full/Dockerfile), [(v2.6.0)](https://github.com/mwz/sonar-scala-docker/releases/tag/2.6.0)
Expand All @@ -31,25 +33,27 @@ Starting from version `2.7.0`, the images no longer contain the [sonar-scala-ext
## What's included
Version | SonarQube | sonar-scala | sonar-scala-extra
--------|-----------|-------------|------------------
2.9.0 | | 6.6.0 |
2.9.0-full | 6.7.5 LTS | 6.6.0 |
2.8.0 | | 6.5.1 |
2.8.0-full | 6.7.5 LTS | 6.5.1 |
2.7.0 | | 6.5.0 |
2.7.0-full | 6.7.4 LTS | 6.5.0 |
2.6.0 | | 6.4.0 | 1.3.0
3.0.0 || 7.0.0
3.0.0-full | 7.3 | 7.0.0
2.9.0 || 6.6.0
2.9.0-full | 6.7.5 LTS | 6.6.0
2.8.0 || 6.5.1
2.8.0-full | 6.7.5 LTS | 6.5.1
2.7.0 || 6.5.0
2.7.0-full | 6.7.4 LTS | 6.5.0
2.6.0 || 6.4.0 | 1.3.0
2.6.0-full | 6.7.4 LTS | 6.4.0 | 1.3.0
2.5.0 | | 6.4.0 | 1.3.0
2.5.0 || 6.4.0 | 1.3.0
2.5.0-full | 6.7.3 LTS | 6.4.0 | 1.3.0
2.4.0 | | 6.3.0 | 1.3.0
2.4.0 || 6.3.0 | 1.3.0
2.4.0-full | 6.7.3 LTS | 6.3.0 | 1.3.0
2.3.0 | | 6.2.0 | 1.3.0
2.3.0 || 6.2.0 | 1.3.0
2.3.0-full | 6.7.3 LTS | 6.2.0 | 1.3.0
2.2.1 | | 6.1.0 | 1.3.0
2.2.1 || 6.1.0 | 1.3.0
2.2.1-full | 6.7.3 LTS | 6.1.0 | 1.3.0
2.2.0 | | 6.1.0 | 1.3.0
2.2.0 || 6.1.0 | 1.3.0
2.2.0-full | 6.7.2 LTS | 6.1.0 | 1.3.0
2.1.0 | | 6.0.0 | 1.3.0
2.1.0 || 6.0.0 | 1.3.0
2.1.0-full | 6.7.1 LTS | 6.0.0 | 1.3.0


Expand All @@ -60,7 +64,7 @@ version: "2"
services:
sonarqube:
image: sonarqube:6.7.5-alpine # lts
image: mwizner/sonarqube:7.3-alpine
ports:
- "80:9000"
networks:
Expand All @@ -69,7 +73,7 @@ services:
- plugins
plugins:
image: mwizner/sonarqube-scala-plugins:2.9.0
image: mwizner/sonarqube-scala-plugins:3.0.0
volumes:
- sonarqube_plugins:/opt/sonarqube/extensions/plugins
command: /bin/true
Expand All @@ -91,7 +95,7 @@ docker run -d --name sonarqube-scala-plugins-full \
-e SONARQUBE_JDBC_USERNAME=sonar \
-e SONARQUBE_JDBC_PASSWORD=sonar \
-e SONARQUBE_JDBC_URL=jdbc:postgresql://localhost/sonar \
mwizner/sonarqube-scala-plugins:2.9.0-full
mwizner/sonarqube-scala-plugins:3.0.0-full
```

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.
Expand Down
2 changes: 1 addition & 1 deletion dev/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
set -eu

export SONAR_SCALA_VERSION=6.7.0-SNAPSHOT
export SONAR_SCALA_VERSION=7.0.0-SNAPSHOT
cp ~/.ivy2/local/com.github.mwz/sonar-scala_2.12/${SONAR_SCALA_VERSION}/jars/sonar-scala_2.12-assembly.jar .
docker build -t mwizner/sonarqube-scala-plugins:dev --build-arg SONAR_SCALA_VERSION=${SONAR_SCALA_VERSION} .
46 changes: 46 additions & 0 deletions docker-compose-lts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
version: "2"

services:
sonarqube:
image: sonarqube:6.7.5-alpine # lts
ports:
- "80:9000"
networks:
- sonarnet
environment:
- SONARQUBE_JDBC_USERNAME=sonar
- SONARQUBE_JDBC_PASSWORD=sonar
- SONARQUBE_JDBC_URL=jdbc:postgresql://db:5432/sonar
volumes:
- sonarqube_conf:/opt/sonarqube/conf
- sonarqube_data:/opt/sonarqube/data
- sonarqube_bundled-plugins:/opt/sonarqube/lib/bundled-plugins
volumes_from:
- plugins
db:
image: postgres:10.5-alpine
networks:
- sonarnet
environment:
- POSTGRES_USER=sonar
- POSTGRES_PASSWORD=sonar
volumes:
- postgresql:/var/lib/postgresql
- postgresql_data:/var/lib/postgresql/data
plugins:
image: mwizner/sonarqube-scala-plugins:2.9.0
volumes:
- sonarqube_plugins:/opt/sonarqube/extensions/plugins
command: /bin/true

networks:
sonarnet:
driver: bridge

volumes:
sonarqube_conf:
sonarqube_data:
sonarqube_bundled-plugins:
sonarqube_plugins:
postgresql:
postgresql_data:
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "2"

services:
sonarqube:
image: sonarqube:6.7.5-alpine # lts
image: mwizner/sonarqube:7.3-alpine
ports:
- "80:9000"
networks:
Expand All @@ -17,7 +17,8 @@ services:
- sonarqube_bundled-plugins:/opt/sonarqube/lib/bundled-plugins
volumes_from:
- plugins

depends_on:
- db
db:
image: postgres:10.5-alpine
networks:
Expand All @@ -28,9 +29,8 @@ services:
volumes:
- postgresql:/var/lib/postgresql
- postgresql_data:/var/lib/postgresql/data

plugins:
image: mwizner/sonarqube-scala-plugins:2.9.0
image: mwizner/sonarqube-scala-plugins:3.0.0
volumes:
- sonarqube_plugins:/opt/sonarqube/extensions/plugins
command: /bin/true
Expand Down
2 changes: 1 addition & 1 deletion release.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -eu

export VERSION=2.9.0
export VERSION=3.0.0

# Build
docker build -t mwizner/sonarqube-scala-plugins:$VERSION -t mwizner/sonarqube-scala-plugins:latest $VERSION
Expand Down

0 comments on commit 1f99f58

Please sign in to comment.