diff --git a/3.0.0-full/Dockerfile b/3.0.0-full/Dockerfile new file mode 100644 index 0000000..3f54f0c --- /dev/null +++ b/3.0.0-full/Dockerfile @@ -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"] diff --git a/3.0.0/Dockerfile b/3.0.0/Dockerfile new file mode 100644 index 0000000..687c4ec --- /dev/null +++ b/3.0.0/Dockerfile @@ -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" diff --git a/README.md b/README.md index 2c6c830..39773e1 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 @@ -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. @@ -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) | @@ -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. diff --git a/README_DOCKERHUB.md b/README_DOCKERHUB.md index 5007e9e..3b2e1ca 100644 --- a/README_DOCKERHUB.md +++ b/README_DOCKERHUB.md @@ -1,4 +1,4 @@ -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 @@ -6,11 +6,13 @@ There are two types of images available: images with [sonar-scala](https://githu 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) @@ -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 @@ -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: @@ -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 @@ -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. diff --git a/dev/build.sh b/dev/build.sh index c9f1df3..a671c23 100755 --- a/dev/build.sh +++ b/dev/build.sh @@ -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} . diff --git a/docker-compose-lts.yml b/docker-compose-lts.yml new file mode 100644 index 0000000..97a27ee --- /dev/null +++ b/docker-compose-lts.yml @@ -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: diff --git a/docker-compose.yml b/docker-compose.yml index 4cf5741..3cb8c1c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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: @@ -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: @@ -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 diff --git a/release.sh b/release.sh index 6db771d..ff31266 100755 --- a/release.sh +++ b/release.sh @@ -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