Skip to content

Commit 688cffc

Browse files
committed
[ISSUE 60] update compatibility to SonarQube 10.6.0
1 parent 42006ef commit 688cffc

File tree

4 files changed

+27
-10
lines changed

4 files changed

+27
-10
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
### Changed
1313

14-
- Check + update for SonarQube 10.6.0 compatibility
14+
- [#60](https://github.com/green-code-initiative/ecoCode-java/issues/60) Check + update for SonarQube 10.6.0 compatibility
15+
- refactoring docker system
1516

1617
### Deleted
1718

Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
FROM maven:3-openjdk-11-slim AS builder
1+
ARG MAVEN_BUILDER=3-openjdk-17-slim
2+
ARG SONARQUBE_VERSION=10.6.0-community
3+
4+
FROM maven:${MAVEN_BUILDER} AS builder
25

36
COPY . /usr/src/ecocode
47

58
WORKDIR /usr/src/ecocode
9+
COPY src src/
10+
COPY pom.xml tool_build.sh ./
11+
612
RUN ./tool_build.sh
713

8-
FROM sonarqube:10.5.1-community
14+
FROM sonarqube:${SONARQUBE_VERSION}
915
COPY --from=builder /usr/src/ecocode/target/ecocode-*.jar /opt/sonarqube/extensions/plugins/
16+
USER sonarqube

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Ready to use binaries are available [from GitHub](https://github.com/green-code-
6565

6666
| Plugin version | SonarQube version | Java version |
6767
|----------------|---------------------|--------------|
68-
| 1.5.+ | 9.4.+ LTS to 10.5.1 | 11 / 17 |
68+
| 1.6.+ | 9.4.+ LTS to 10.6.0 | 11 / 17 |
6969

7070
> Compatibility table of versions lower than 1.4.+ are available from the
7171
> main [ecoCode repository](https://github.com/green-code-initiative/ecoCode#-plugins-version-compatibility).

docker-compose.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
1-
version: "3.3"
1+
name: sonarqube_ecocode_java
2+
23
services:
34
sonar:
4-
image: sonarqube:10.6.0-community
5+
build: .
56
container_name: sonar_ecocode_java
67
ports:
78
- ":9000"
89
networks:
910
- sonarnet
1011
depends_on:
11-
- db
12+
db:
13+
condition: service_healthy
1214
environment:
1315
SONAR_JDBC_USERNAME: sonar
1416
SONAR_JDBC_PASSWORD: sonar
1517
SONAR_JDBC_URL: jdbc:postgresql://db:5432/sonarqube
1618
SONAR_ES_BOOTSTRAP_CHECKS_DISABLE: 'true'
19+
env_file:
20+
- path: ./.default.docker.env
21+
required: true
22+
- path: ./.override.docker.env
23+
required: false
1724
volumes:
18-
- type: bind
19-
source: ./target/ecocode-java-plugin-1.6.2-SNAPSHOT.jar
20-
target: /opt/sonarqube/extensions/plugins/ecocode-java-plugin-1.6.2-SNAPSHOT.jar
2125
- "extensions:/opt/sonarqube/extensions"
2226
- "logs:/opt/sonarqube/logs"
2327
- "data:/opt/sonarqube/data"
@@ -34,6 +38,11 @@ services:
3438
POSTGRES_PASSWORD: sonar
3539
POSTGRES_DB: sonarqube
3640
PGDATA: pg_data:/var/lib/postgresql/data/pgdata
41+
healthcheck:
42+
test: [ "CMD-SHELL", "pg_isready -U sonar -d sonarqube" ]
43+
interval: 5s
44+
timeout: 5s
45+
retries: 5
3746

3847
networks:
3948
sonarnet:

0 commit comments

Comments
 (0)