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

Commit

Permalink
Upgrade SonarQube to 8.7.1 & sonar-scala to 8.7.0 (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwz authored May 2, 2021
1 parent 5c3deed commit 8c0b79b
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 49 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Test
on:
pull_request:
jobs:
test:
name: Test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Docker build
run: |
export VERSION=`jq -r '.current.version' vars.json`
docker build -t mwizner/sonarqube-scala-plugins:$VERSION current
docker build -t mwizner/sonarqube-scala-plugins:$VERSION-full current/full
- name: Docker build LTS
run: |
export VERSION_LTS=`jq -r '.lts.version' vars.json`
docker build -t mwizner/sonarqube-scala-plugins:$VERSION_LTS lts
docker build -t mwizner/sonarqube-scala-plugins:$VERSION_LTS-full lts/full
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# sonar-scala-docker

[![GitHub version](<https://img.shields.io/badge/release_(for_SonarQube_8.5.1)-v5.6.0-blue.svg>)](https://github.com/mwz/sonarqube-scala-docker/releases)
[![GitHub version](<https://img.shields.io/badge/release_(for_SonarQube_8.7.1)-v5.7.0-blue.svg>)](https://github.com/mwz/sonarqube-scala-docker/releases)
[![GitHub version lts](<https://img.shields.io/badge/release_(for_SonarQube_LTS_7.9)-v4.2.0-blue.svg>)](https://github.com/mwz/sonarqube-scala-docker/releases)
[![GitHub version lts 6.7](<https://img.shields.io/badge/release_(for_SonarQube_LTS_6.7)-v2.12.0-blue.svg>)](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)

Docker images and docker-compose recipes for out-of-the-box
[SonarQube 6.7 LTS](https://www.sonarqube.org/sonarqube-6-7-lts),
[SonarQube 7.9 LTS](https://www.sonarqube.org/sonarqube-7-9-lts) and
[SonarQube 8.5.1](https://www.sonarqube.org) instance with support
[SonarQube 8.7.1](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) +
Expand All @@ -35,7 +35,7 @@ default SonarQube login details for the Administrator account are `admin:admin`.

You can also use a standalone docker image which contains SonarQube server with
bundled sonar-scala plugin,
[`mwizner/sonarqube-scala-plugins:5.6.0-full`](https://hub.docker.com/r/mwizner/sonarqube-scala-plugins)(or
[`mwizner/sonarqube-scala-plugins:5.7.0-full`](https://hub.docker.com/r/mwizner/sonarqube-scala-plugins)(or
`mwizner/sonarqube-scala-plugins:latest-full`) and
[`mwizner/sonarqube-scala-plugins:4.2.0-full`](https://hub.docker.com/r/mwizner/sonarqube-scala-plugins)
(or `mwizner/sonarqube-scala-plugins:latest-lts-full`) for the current LTS
Expand All @@ -54,7 +54,7 @@ docker run -d \
-e SONARQUBE_JDBC_USERNAME=sonar \
-e SONARQUBE_JDBC_PASSWORD=sonar \
-e SONARQUBE_JDBC_URL=jdbc:postgresql://localhost/sonar \
mwizner/sonarqube-scala-plugins:5.6.0-full
mwizner/sonarqube-scala-plugins:5.7.0-full
```

Please note that if you don't specify the `SONARQUBE_JDBC_URL` variable,
Expand All @@ -66,14 +66,14 @@ want to try the image, you can use the following command:
docker run -d \
--name sonarqube-scala-plugins-full \
-p 80:9000 \
mwizner/sonarqube-scala-plugins:5.6.0-full
mwizner/sonarqube-scala-plugins:5.7.0-full
```

## Dependencies

- [SonarQube 6.7 LTS](https://hub.docker.com/_/sonarqube) /
[SonarQube 7.9 LTS](https://hub.docker.com/_/sonarqube) /
[SonarQube 8.5.1](https://hub.docker.com/_/sonarqube)
[SonarQube 8.7.1](https://hub.docker.com/_/sonarqube)
- [PostgreSQL 12](https://hub.docker.com/_/postgres)
- [mwz/sonar-scala](https://github.com/mwz/sonar-scala) - provides support for
scalastyle, scoverage and scapegoat
Expand All @@ -87,7 +87,7 @@ scapegoat support)_
<!-- prettier-ignore-start -->
|Version | SonarQube | sonar-scala |
|--------|-----------|-------------|
[5.6.0](https://github.com/mwz/sonarqube-scala-docker/releases/tag/5.6.0) | 8.5.1 [documentation](https://docs.sonarqube.org/8.5), [changelog](https://jira.sonarsource.com/secure/ReleaseNote.jspa?projectId=10930&version=16342) | [8.6.0](https://github.com/mwz/sonar-scala/releases/tag/v8.6.0)
[5.7.0](https://github.com/mwz/sonarqube-scala-docker/releases/tag/5.7.0) | 8.7.1 [documentation](https://docs.sonarqube.org/8.7), [changelog](https://jira.sonarsource.com/secure/ReleaseNote.jspa?projectId=10930&version=16540) | [8.7.0](https://github.com/mwz/sonar-scala/releases/tag/v8.7.0)
[4.2.0](https://github.com/mwz/sonarqube-scala-docker/releases/tag/4.2.0) | 7.9.1 LTS [documentation](https://docs.sonarqube.org/7.9), [changelog](https://jira.sonarsource.com/secure/ReleaseNote.jspa?projectId=10930&version=15029) | [7.9.0](https://github.com/mwz/sonar-scala/releases/tag/v7.9.0)
[2.12.0](https://github.com/mwz/sonarqube-scala-docker/releases/tag/2.12.0) | 6.7.7 LTS [documentation](https://docs.sonarqube.org/display/SONARQUBE67/Documentation), [changelog](https://jira.sonarsource.com/jira/secure/ReleaseNote.jspa?projectId=10930&version=14865) | [6.8.0](https://github.com/mwz/sonar-scala/releases/tag/v6.8.0)
<!-- prettier-ignore-end -->
Expand All @@ -101,6 +101,12 @@ scapegoat support)_
<td><b>sonar-scala</b></td>
<td><b>sonar-scala-extra</b></td>
</tr>
<tr>
<td><a href="https://github.com/mwz/sonarqube-scala-docker/releases/tag/5.6.0">5.6.0</a></td>
<td>8.5.1 <a href="https://docs.sonarqube.org/8.5">documentation</a>, <a href="https://jira.sonarsource.com/secure/ReleaseNote.jspa?projectId=10930&version=16342">changelog</a></td>
<td><a href="https://github.com/mwz/sonar-scala/releases/tag/v8.6.0">8.6.0</td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/mwz/sonarqube-scala-docker/releases/tag/5.5.0">5.5.0</a></td>
<td>8.4.2 <a href="https://docs.sonarqube.org/8.4">documentation</a>, <a href="https://jira.sonarsource.com/secure/ReleaseNote.jspa?projectId=10930&version=15833">changelog</a></td>
Expand Down Expand Up @@ -299,6 +305,7 @@ way to automate analysis of Scala projects with SonarQube.
<details>
<summary>Expand to see the changelog.</summary>
<ul>
<li><strong>5.7.0</strong> - Upgraded sonar-scala to 8.7.0 & SonarQube to 8.7.1.</li>
<li><strong>5.6.0</strong> - Upgraded sonar-scala to 8.6.0 & SonarQube to 8.5.1.</li>
<li><strong>5.5.0</strong> - Upgraded sonar-scala to 8.5.0 & SonarQube to 8.4.</li>
<li><strong>5.4.0</strong> - Upgraded sonar-scala to 8.4.0.</li>
Expand Down
1 change: 1 addition & 0 deletions README.tpl.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ way to automate analysis of Scala projects with SonarQube.
<details>
<summary>Expand to see the changelog.</summary>
<ul>
<li><strong>5.7.0</strong> - Upgraded sonar-scala to 8.7.0 & SonarQube to 8.7.1.</li>
<li><strong>5.6.0</strong> - Upgraded sonar-scala to 8.6.0 & SonarQube to 8.5.1.</li>
<li><strong>5.5.0</strong> - Upgraded sonar-scala to 8.5.0 & SonarQube to 8.4.</li>
<li><strong>5.4.0</strong> - Upgraded sonar-scala to 8.4.0.</li>
Expand Down
24 changes: 12 additions & 12 deletions README_DOCKERHUB.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Docker images with out-of-the-box
[SonarQube 6.7 LTS](https://www.sonarqube.org/sonarqube-6-7-lts),
[SonarQube 7.9 LTS](https://www.sonarqube.org/sonarqube-7-9-lts) and
[SonarQube 8.5.1](https://www.sonarqube.org) instance with support
[SonarQube 8.7.1](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)** +
Expand All @@ -18,11 +18,11 @@ 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.

- `5.6.0`, `latest`
[Dockerfile](https://github.com/mwz/sonar-scala-docker/blob/master/5.6.0/Dockerfile),
`5.6.0-full`, `latest-full`
[Dockerfile](https://github.com/mwz/sonar-scala-docker/blob/master/5.6.0-full/Dockerfile),
[Release 5.6.0](https://github.com/mwz/sonar-scala-docker/releases/tag/5.6.0)
- `5.7.0`, `latest`
[Dockerfile](https://github.com/mwz/sonar-scala-docker/blob/master/5.7.0/Dockerfile),
`5.7.0-full`, `latest-full`
[Dockerfile](https://github.com/mwz/sonar-scala-docker/blob/master/5.7.0-full/Dockerfile),
[Release 5.7.0](https://github.com/mwz/sonar-scala-docker/releases/tag/5.7.0)
- `4.2.0`, `latest-lts` (7.9 LTS)
[Dockerfile](https://github.com/mwz/sonar-scala-docker/blob/master/4.2.0/Dockerfile),
`4.2.0-full`, `latest-lts-full` (7.9 LTS)
Expand All @@ -41,8 +41,8 @@ For older versions please check the

| Version | SonarQube | sonar-scala |
| ------------------------ | ----------------- | ---------------------- |
| 5.6.0 | | 8.6.0 |
| 5.6.0-full | 8.5.1 | 8.6.0 |
| 5.7.0 | | 8.7.0 |
| 5.7.0-full | 8.7.1 | 8.7.0 |
| 4.2.0 | | 7.9.0 |
| 4.2.0-full | 7.9.1 LTS | 7.9.0 |
| 2.12.0 | | 6.8.0 |
Expand All @@ -58,7 +58,7 @@ version: "2"
services:
sonarqube:
image: sonarqube:8.5.1-community
image: sonarqube:8.7.1-community
ports:
- "80:9000"
networks:
Expand All @@ -67,7 +67,7 @@ services:
- plugins
plugins:
image: mwizner/sonarqube-scala-plugins:5.6.0
image: mwizner/sonarqube-scala-plugins:5.7.0
volumes:
- sonarqube_plugins:/opt/sonarqube/extensions/plugins
command: /bin/true
Expand Down Expand Up @@ -95,7 +95,7 @@ docker run -d \
-e SONARQUBE_JDBC_USERNAME=sonar \
-e SONARQUBE_JDBC_PASSWORD=sonar \
-e SONARQUBE_JDBC_URL=jdbc:postgresql://localhost/sonar \
mwizner/sonarqube-scala-plugins:5.6.0-full
mwizner/sonarqube-scala-plugins:5.7.0-full
```

Please note that if you don't specify the `SONARQUBE_JDBC_URL` variable,
Expand All @@ -107,7 +107,7 @@ want to try the image, you can use the following command:
docker run -d \
--name sonarqube-scala-plugins-full \
-p 80:9000 \
mwizner/sonarqube-scala-plugins:5.6.0-full
mwizner/sonarqube-scala-plugins:5.7.0-full
```

## Repository
Expand Down
28 changes: 13 additions & 15 deletions conf/sonar.properties
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@
# A database named sonar must exist and its collation must be case-sensitive (CS) and accent-sensitive (AS)
# Use the following connection string if you want to use integrated security with Microsoft Sql Server
# Do not set sonar.jdbc.username or sonar.jdbc.password property if you are using Integrated Security
# For Integrated Security to work, you have to download the Microsoft SQL JDBC driver package from
# https://www.microsoft.com/en-us/download/details.aspx?id=55539
# and copy sqljdbc_auth.dll to your path. You have to copy the 32 bit or 64 bit version of the dll
# depending upon the architecture of your server machine.
# For Integrated Security to work, you have to download the Microsoft SQL JDBC Driver 9.2.0 package from
# https://docs.microsoft.com/en-us/sql/connect/jdbc/release-notes-for-the-jdbc-driver?view=sql-server-ver15#92
# and copy mssql-jdbc_auth-9.2.0.x64.dll to your path.
#sonar.jdbc.url=jdbc:sqlserver://localhost;databaseName=sonar;integratedSecurity=true

# Use the following connection string if you want to use SQL Auth while connecting to MS Sql Server.
Expand Down Expand Up @@ -242,7 +241,8 @@
#--------------------------------------------------------------------------------------------------
# ELASTICSEARCH
# Elasticsearch is used to facilitate fast and accurate information retrieval.
# It is executed in a dedicated Java process. Default heap size is 512MB.
# It is executed in a dedicated Java process. Default maximum heap size is 512MB.
# It is recommended to also set MaxDirectMemorySize (-XX:MaxDirectMemorySize) and set it to half the maximum heap size.
#
# --------------------------------------------------
# Word of caution for Linux users on 64bits systems
Expand All @@ -256,15 +256,19 @@
#

# JVM options of Elasticsearch process
#sonar.search.javaOpts=-Xmx512m -Xms512m -XX:+HeapDumpOnOutOfMemoryError
#sonar.search.javaOpts=-Xmx512m -Xms512m -XX:MaxDirectMemorySize=256m -XX:+HeapDumpOnOutOfMemoryError

# Same as previous property, but allows to not repeat all other settings like -Xmx
#sonar.search.javaAdditionalOpts=

# Elasticsearch port. Default is 9001. Use 0 to get a free port.
# Elasticsearch port for incoming HTTP connections. Default is 9001. Use 0 to get a free port.
# As a security precaution, should be blocked by a firewall and not exposed to the Internet.
#sonar.search.port=9001

# Elasticsearch TCP transport port that is bound to loopback address. When nothing is set, a random port will be chosen.
# As a security precaution, your OS configuration should not expose this port for external access.
#sonar.es.port=

# Elasticsearch host. The search server will bind this address and the search client will connect to it.
# Default is loopback address.
# As a security precaution, should NOT be set to a publicly available address.
Expand Down Expand Up @@ -311,8 +315,9 @@
# Compute Engine (aka. CE) logs in ce.log
# Elasticsearch (aka. ES) logs in es.log
#
# All 4 files follow the same rolling policy (see sonar.log.rollingPolicy and sonar.log.maxFiles) but it applies
# Depending on the startup, all 4 files follow the same rolling policy (see sonar.log.rollingPolicy and sonar.log.maxFiles) but it applies
# individually (eg. if sonar.log.maxFiles=4, there can be at most 4 of each files, ie. 16 files in total).
# If the SonarQube wrapper is used (for example, with the provided start.sh script), the sonar.log rotation policy needs to be set in the wrapper.conf
#
# All 4 files have logs in the same format:
# 1 2 3 4 5 6
Expand Down Expand Up @@ -400,10 +405,3 @@
# We don't collect source code or IP addresses. And we don't share the data with anyone else.
# To see an example of the data shared: login as a global administrator, call the WS api/system/info and check the Statistics field.
sonar.telemetry.enable=false

#--------------------------------------------------------------------------------------------------
# DEVELOPMENT - only for developers
# The following properties MUST NOT be used in production environments.

# Elasticsearch HTTP connector
#sonar.search.httpPort=-1
4 changes: 2 additions & 2 deletions current/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
FROM bitnami/minideb:stretch
RUN install_packages curl ca-certificates

ENV SONAR_SCALA_VERSION 8.6.0
ENV SONAR_SCALA_VERSION 8.7.0
ENV SQ_EXTENSIONS_DIR "/opt/sonarqube/extensions"

RUN groupadd -g 1000 -r sonarqube && useradd -r -g sonarqube sonarqube
RUN curl --create-dirs -L -o "${SQ_EXTENSIONS_DIR}/plugins/sonar-scala-plugin-${SONAR_SCALA_VERSION}.jar" \
"https://dl.bintray.com/mwz/maven/com/github/mwz/sonar-scala_2.13/${SONAR_SCALA_VERSION}/sonar-scala_2.13-${SONAR_SCALA_VERSION}-assembly.jar" && \
"https://s01.oss.sonatype.org/content/repositories/releases/com/sonar-scala/sonar-scala_2.13/${SONAR_SCALA_VERSION}/sonar-scala_2.13-${SONAR_SCALA_VERSION}-assembly.jar" && \
chown -R sonarqube:sonarqube /opt/sonarqube && \
chmod 777 $SQ_EXTENSIONS_DIR/plugins/*
8 changes: 4 additions & 4 deletions current/full/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# SonarQube 8.5 image with bundled sonar-scala (https://github.com/mwz/sonar-scala).
# SonarQube 8.7 image with bundled sonar-scala (https://github.com/mwz/sonar-scala).

FROM sonarqube:8.5.1-community
FROM sonarqube:8.7.1-community

ENV SONAR_SCALA_VERSION 8.6.0
ENV SONAR_SCALA_VERSION 8.7.0

RUN rm $SONARQUBE_HOME/lib/extensions/sonar-scala* && \
wget -O "${SQ_EXTENSIONS_DIR}/plugins/sonar-scala-plugin-${SONAR_SCALA_VERSION}.jar" \
"https://dl.bintray.com/mwz/maven/com/github/mwz/sonar-scala_2.13/${SONAR_SCALA_VERSION}/sonar-scala_2.13-${SONAR_SCALA_VERSION}-assembly.jar" && \
"https://s01.oss.sonatype.org/content/repositories/releases/com/sonar-scala/sonar-scala_2.13/${SONAR_SCALA_VERSION}/sonar-scala_2.13-${SONAR_SCALA_VERSION}-assembly.jar" && \
chown sonarqube:sonarqube $SQ_EXTENSIONS_DIR/plugins/sonar-scala-plugin-* && \
chmod 777 $SQ_EXTENSIONS_DIR/plugins/sonar-scala-plugin-*

Expand Down
4 changes: 2 additions & 2 deletions 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=8.7.0-SNAPSHOT
cp ~/.ivy2/local/com.github.mwz/sonar-scala_2.13/${SONAR_SCALA_VERSION}/jars/sonar-scala_2.13-assembly.jar .
export SONAR_SCALA_VERSION=8.7.0+7-b082d533-SNAPSHOT
cp ~/.ivy2/local/com.sonar-scala/sonar-scala_2.13/${SONAR_SCALA_VERSION}/jars/sonar-scala_2.13-assembly.jar .
docker build -t mwizner/sonarqube-scala-plugins:dev --build-arg SONAR_SCALA_VERSION=${SONAR_SCALA_VERSION} .
4 changes: 2 additions & 2 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:8.5.1-community
image: sonarqube:8.7.1-community
ports:
- "80:9000"
networks:
Expand All @@ -22,7 +22,7 @@ services:
- db
entrypoint: ["bash", "-c", "rm lib/extensions/sonar-scala*; bin/run.sh"]
db:
image: postgres:12.5-alpine
image: postgres:12.6-alpine
networks:
- sonarnet
environment:
Expand Down
17 changes: 12 additions & 5 deletions vars.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"current": {
"version": "5.6.0",
"sonar": "8.5.1",
"sonarDocs": "https://docs.sonarqube.org/8.5",
"sonarChangelog": "https://jira.sonarsource.com/secure/ReleaseNote.jspa?projectId=10930&version=16342",
"sonarScala": "8.6.0"
"version": "5.7.0",
"sonar": "8.7.1",
"sonarDocs": "https://docs.sonarqube.org/8.7",
"sonarChangelog": "https://jira.sonarsource.com/secure/ReleaseNote.jspa?projectId=10930&version=16540",
"sonarScala": "8.7.0"
},
"lts": {
"version": "4.2.0",
Expand All @@ -22,6 +22,13 @@
},
"versions": {
"current": [
{
"version": "5.6.0",
"sonar": "8.5.1",
"sonarDocs": "https://docs.sonarqube.org/8.5",
"sonarChangelog": "https://jira.sonarsource.com/secure/ReleaseNote.jspa?projectId=10930&version=16342",
"sonarScala": "8.6.0"
},
{
"version": "5.5.0",
"sonar": "8.4.2",
Expand Down

0 comments on commit 8c0b79b

Please sign in to comment.