From 09281323b0d57d9966272d4b0755ded0f5bf3614 Mon Sep 17 00:00:00 2001 From: David DE CARVALHO Date: Wed, 8 Jan 2025 23:05:30 +0100 Subject: [PATCH 1/5] use a dynamic port for server --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index bcefd31..073ac20 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ services: context: . container_name: sonar_creedengo_ios ports: - - "9000:9000" + - ":9000" networks: - sonarnet depends_on: From c91ed4cc58f9c34cf7ae5d8ab9279d5d665be0cc Mon Sep 17 00:00:00 2001 From: David DE CARVALHO Date: Wed, 8 Jan 2025 23:11:56 +0100 Subject: [PATCH 2/5] upgrade docker system to be more dynamic --- Dockerfile | 20 +++++++++++++++++--- docker-compose.yml | 24 ++++++++++++++++-------- 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 34e5f5e..39e8606 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,19 @@ -FROM sonarqube:10.5.0-community -USER root +ARG MAVEN_BUILDER=3-openjdk-17-slim +#ARG SONARQUBE_VERSION=24.12.0.100206-community +ARG SONARQUBE_VERSION=10.5.0-community + +FROM maven:${MAVEN_BUILDER} AS builder + +COPY . /usr/src/creedengo + +WORKDIR /usr/src/creedengo +COPY src src/ +COPY pom.xml tool_build.sh ./ + +RUN ./tool_build.sh + +FROM sonarqube:${SONARQUBE_VERSION} +COPY --from=builder /usr/src/creedengo/target/creedengo-*.jar /opt/sonarqube/extensions/plugins/ ADD https://github.com/insideapp-oss/sonar-apple/releases/download/0.5.0/sonar-apple-plugin-0.5.0.jar /opt/sonarqube/extensions/plugins/sonar-apple-plugin-0.5.0.jar RUN chmod 777 /opt/sonarqube/extensions/plugins/sonar-apple-plugin-0.5.0.jar -USER sonarqube \ No newline at end of file +USER sonarqube diff --git a/docker-compose.yml b/docker-compose.yml index 073ac20..046412d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,25 +1,28 @@ -version: "3.3" +name: sonarqube_creedengo_ios + services: sonar: - build: - dockerfile: Dockerfile - context: . + build: . container_name: sonar_creedengo_ios 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: ./sonar-ios-plugin/target/creedengo-sonar-ios-plugin-2.0.0-SNAPSHOT.jar - target: /opt/sonarqube/extensions/plugins/creedengo-sonar-ios-plugin-2.0.0-SNAPSHOT.jar + - "extensions:/opt/sonarqube/extensions" - "logs:/opt/sonarqube/logs" - "data:/opt/sonarqube/data" db: @@ -34,6 +37,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: From bd80d38502965d62142d0d59e9357f5bc9af81c4 Mon Sep 17 00:00:00 2001 From: David DE CARVALHO Date: Wed, 8 Jan 2025 23:26:46 +0100 Subject: [PATCH 3/5] upgrade docker system to be more dynamic - fix --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 39e8606..e791490 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,13 +7,14 @@ FROM maven:${MAVEN_BUILDER} AS builder COPY . /usr/src/creedengo WORKDIR /usr/src/creedengo -COPY src src/ +COPY sonar-ios-plugin/src src/ COPY pom.xml tool_build.sh ./ RUN ./tool_build.sh FROM sonarqube:${SONARQUBE_VERSION} -COPY --from=builder /usr/src/creedengo/target/creedengo-*.jar /opt/sonarqube/extensions/plugins/ +USER root ADD https://github.com/insideapp-oss/sonar-apple/releases/download/0.5.0/sonar-apple-plugin-0.5.0.jar /opt/sonarqube/extensions/plugins/sonar-apple-plugin-0.5.0.jar RUN chmod 777 /opt/sonarqube/extensions/plugins/sonar-apple-plugin-0.5.0.jar +COPY --from=builder /usr/src/creedengo/sonar-ios-plugin/target/creedengo-*.jar /opt/sonarqube/extensions/plugins/ USER sonarqube From 10b119e7e413aea6b26815236f6724bd4f55c6b5 Mon Sep 17 00:00:00 2001 From: David DE CARVALHO Date: Wed, 8 Jan 2025 23:34:53 +0100 Subject: [PATCH 4/5] update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ecc3298..8d31a97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#23](https://github.com/green-code-initiative/creedengo-ios/pull/23) Docker update (updated SonarQube and sonar-apple versions) - [#37](https://github.com/green-code-initiative/creedengo-ios/issues/37) Renaming to Creedengo +- [#39](https://github.com/green-code-initiative/creedengo-ios/pull/39) technical upgrade on docker system ### Deleted From e030397860963603ddedb882ba43530ce16530d0 Mon Sep 17 00:00:00 2001 From: David DE CARVALHO Date: Thu, 9 Jan 2025 23:38:29 +0100 Subject: [PATCH 5/5] add 24.12 sonarqube version --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index e791490..111e99f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,5 @@ ARG MAVEN_BUILDER=3-openjdk-17-slim -#ARG SONARQUBE_VERSION=24.12.0.100206-community -ARG SONARQUBE_VERSION=10.5.0-community +ARG SONARQUBE_VERSION=24.12.0.100206-community FROM maven:${MAVEN_BUILDER} AS builder