Skip to content

Commit

Permalink
[ISSUE 60] update compatibility to SonarQube 10.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dedece35 committed Jul 21, 2024
1 parent 42006ef commit 688cffc
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 10 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

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

### Deleted

Expand Down
11 changes: 9 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
FROM maven:3-openjdk-11-slim AS builder
ARG MAVEN_BUILDER=3-openjdk-17-slim
ARG SONARQUBE_VERSION=10.6.0-community

FROM maven:${MAVEN_BUILDER} AS builder

COPY . /usr/src/ecocode

WORKDIR /usr/src/ecocode
COPY src src/
COPY pom.xml tool_build.sh ./

RUN ./tool_build.sh

FROM sonarqube:10.5.1-community
FROM sonarqube:${SONARQUBE_VERSION}
COPY --from=builder /usr/src/ecocode/target/ecocode-*.jar /opt/sonarqube/extensions/plugins/
USER sonarqube
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Ready to use binaries are available [from GitHub](https://github.com/green-code-

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

> Compatibility table of versions lower than 1.4.+ are available from the
> main [ecoCode repository](https://github.com/green-code-initiative/ecoCode#-plugins-version-compatibility).
Expand Down
21 changes: 15 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
version: "3.3"
name: sonarqube_ecocode_java

services:
sonar:
image: sonarqube:10.6.0-community
build: .
container_name: sonar_ecocode_java
ports:
- ":9000"
networks:
- sonarnet
depends_on:
- db
db:
condition: service_healthy
environment:
SONAR_JDBC_USERNAME: sonar
SONAR_JDBC_PASSWORD: sonar
SONAR_JDBC_URL: jdbc:postgresql://db:5432/sonarqube
SONAR_ES_BOOTSTRAP_CHECKS_DISABLE: 'true'
env_file:
- path: ./.default.docker.env
required: true
- path: ./.override.docker.env
required: false
volumes:
- type: bind
source: ./target/ecocode-java-plugin-1.6.2-SNAPSHOT.jar
target: /opt/sonarqube/extensions/plugins/ecocode-java-plugin-1.6.2-SNAPSHOT.jar
- "extensions:/opt/sonarqube/extensions"
- "logs:/opt/sonarqube/logs"
- "data:/opt/sonarqube/data"
Expand All @@ -34,6 +38,11 @@ services:
POSTGRES_PASSWORD: sonar
POSTGRES_DB: sonarqube
PGDATA: pg_data:/var/lib/postgresql/data/pgdata
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U sonar -d sonarqube" ]
interval: 5s
timeout: 5s
retries: 5

networks:
sonarnet:
Expand Down

0 comments on commit 688cffc

Please sign in to comment.