From ea7197b7cd838c19f3bb9eb8f520aa4fa0349ea6 Mon Sep 17 00:00:00 2001 From: Florian Wilhelm Date: Tue, 29 Oct 2024 13:57:52 +0100 Subject: [PATCH] wip use exploded jar --- .github/workflows/ci.yaml | 12 ++++++++++-- .gitignore | 2 ++ Containerfile | 11 +++++------ 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a43b2b1..5d126c8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -51,6 +51,14 @@ jobs: name: build-artifacts path: 'build' + - run: java -Djarmode=tools -jar build/libs/glvd-0.0.1-SNAPSHOT.jar extract + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: extracted-jar + path: 'glvd-0.0.1-SNAPSHOT' + container-image: runs-on: ubuntu-24.04 needs: @@ -67,8 +75,8 @@ jobs: - name: Download built jar uses: actions/download-artifact@v4 with: - name: build-artifacts - path: build + name: extracted-jar + path: 'glvd-0.0.1-SNAPSHOT' - name: Install qemu dependency for multi-arch build run: | diff --git a/.gitignore b/.gitignore index f8d0889..2c2761c 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,5 @@ out/ ### Unbase OCI ### *.oci + +glvd-*-SNAPSHOT diff --git a/Containerfile b/Containerfile index 56affff..95fbde8 100644 --- a/Containerfile +++ b/Containerfile @@ -3,14 +3,13 @@ RUN apt-get update -q && apt-get install -y binutils RUN mkdir /usr/src/glvd COPY . /usr/src/glvd WORKDIR /usr/src/glvd -COPY build/libs/glvd-0.0.1-SNAPSHOT.jar glvd-0.0.1-SNAPSHOT.jar -RUN jar xf glvd-0.0.1-SNAPSHOT.jar +COPY glvd-0.0.1-SNAPSHOT . RUN jdeps --ignore-missing-deps -q \ --recursive \ --multi-release 21 \ --print-module-deps \ - --class-path 'BOOT-INF/lib/*' \ - glvd-0.0.1-SNAPSHOT.jar > deps.info + --class-path 'glvd-0.0.1-SNAPSHOT/lib/*' \ + glvd-0.0.1-SNAPSHOT/glvd-0.0.1-SNAPSHOT.jar > deps.info RUN jlink \ --add-modules $(cat deps.info) \ --strip-debug \ @@ -23,6 +22,6 @@ FROM ghcr.io/gardenlinux/gardenlinux:1592 EXPOSE 8080 COPY --from=build /tinysapmachine /jre -COPY --from=build /usr/src/glvd/glvd-0.0.1-SNAPSHOT.jar / +COPY --from=build /usr/src/glvd/glvd-0.0.1-SNAPSHOT / -CMD ["/jre/bin/java", "-jar", "/glvd-0.0.1-SNAPSHOT.jar"] +CMD ["/jre/bin/java", "-jar", "/glvd-0.0.1-SNAPSHOT/glvd-0.0.1-SNAPSHOT.jar"]