From dcf04973d33800cfd707c4a82ce14f70158469ef Mon Sep 17 00:00:00 2001 From: Julian Psotta Date: Sun, 18 Feb 2024 11:35:12 +0100 Subject: [PATCH 1/2] build(maven): Move the war/jar logic to the main pom.xml This allows us to use the packagingValue inside the ors-report-aggregation as well and build it in jar/war mode. Before, we always needed to exclude the package when building with war target. --- Dockerfile | 4 ++-- ors-api/pom.xml | 24 ------------------------ ors-report-aggregation/pom.xml | 2 +- pom.xml | 24 ++++++++++++++++++++++++ 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9801914deb..b7a01e2d13 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,8 +43,8 @@ COPY ors-engine /ors-core/ors-engine COPY pom.xml /ors-core/pom.xml COPY ors-report-aggregation /ors-core/ors-report-aggregation -# Build the project and ignore the report aggregation module as not needed for the API -RUN mvn package -DskipTests -pl '!ors-report-aggregation' +# Build the project and ignore the report aggregation module as not needed for the API build war +RUN mvn package -DskipTests -P buildWar # build final image, just copying stuff inside FROM amazoncorretto:17.0.7-alpine3.17 as publish diff --git a/ors-api/pom.xml b/ors-api/pom.xml index 3befe396b3..1dda8a7c28 100644 --- a/ors-api/pom.xml +++ b/ors-api/pom.xml @@ -39,15 +39,6 @@ ${packagingValue} - - - jar - - ors src/main/java @@ -290,21 +281,6 @@ - - buildWar - - war - - - - buildFatJar - - jar - - - true - - apitests diff --git a/ors-report-aggregation/pom.xml b/ors-report-aggregation/pom.xml index 715376e981..724af72352 100644 --- a/ors-report-aggregation/pom.xml +++ b/ors-report-aggregation/pom.xml @@ -23,7 +23,7 @@ org.heigit.ors ors-api ${project.version} - jar + ${packagingValue} diff --git a/pom.xml b/pom.xml index 0abeaef153..50d36bed6c 100644 --- a/pom.xml +++ b/pom.xml @@ -33,6 +33,12 @@ + + jar 17 ${java.version} ${java.version} @@ -81,6 +87,24 @@ + + + buildWar + + war + + + + buildFatJar + + jar + + + true + + + + From b7d49ae404a0c21c3d35a0bc5221c7a3965a8b77 Mon Sep 17 00:00:00 2001 From: Julian Psotta Date: Mon, 19 Feb 2024 10:57:44 +0100 Subject: [PATCH 2/2] ci(workflow): Update docker/setup-qemu-action This updates docker/setup-qemu-action@v2 to docker/setup-qemu-action@v3. This brings speed improvements! --- .github/workflows/docker-build-and-test.yml | 4 ++-- .github/workflows/vulnerability-scanning.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-build-and-test.yml b/.github/workflows/docker-build-and-test.yml index 1f99815b86..8622cf35a1 100644 --- a/.github/workflows/docker-build-and-test.yml +++ b/.github/workflows/docker-build-and-test.yml @@ -33,7 +33,7 @@ jobs: with: fetch-depth: 0 - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 id: buildx @@ -84,7 +84,7 @@ jobs: echo "HEALTH_WAIT_TIME=260" >> $GITHUB_ENV fi - name: Set up QEMU for ${{ matrix.platform }} - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 with: platforms: ${{ matrix.platform }} - name: Set up Docker Buildx diff --git a/.github/workflows/vulnerability-scanning.yml b/.github/workflows/vulnerability-scanning.yml index e7f8fbc943..9d8c4aa6f4 100644 --- a/.github/workflows/vulnerability-scanning.yml +++ b/.github/workflows/vulnerability-scanning.yml @@ -101,7 +101,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - name: Set up QEMU for ${{ matrix.platform }} - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 with: platforms: ${{ matrix.platform }} - name: Set up Docker Buildx