diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c06daf9bf..12f9be107 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -36,5 +36,5 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - - \ No newline at end of file + build-args: | + "VER=${{ github.event.release.name }}" diff --git a/Dockerfile b/Dockerfile index 126100b88..9b4781ec0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,18 @@ FROM maven:3-eclipse-temurin-21-alpine AS build +ARG VER=0.4.0 COPY application /tmp/application COPY frontend /tmp/frontend COPY modules /tmp/modules COPY pom.xml /tmp/pom.xml WORKDIR /tmp RUN --mount=type=cache,target=/root/.m2,source=/cache/.m2,from=ghcr.io/scc-digitalhub/digitalhub-core:cache \ - mvn install -pl modules/commons + mvn -Drevision=${VER} install -pl modules/commons RUN --mount=type=cache,target=/root/.m2,source=/cache/.m2,from=ghcr.io/scc-digitalhub/digitalhub-core:cache \ --mount=type=cache,target=/tmp/frontend/target,source=/cache/frontend/target,from=ghcr.io/scc-digitalhub/digitalhub-core:cache \ --mount=type=cache,target=/tmp/frontend/console/node_modules,source=/cache/frontend/console/node_modules,from=ghcr.io/scc-digitalhub/digitalhub-core:cache \ - mvn install -pl frontend + mvn -Drevision=${VER} install -pl frontend RUN --mount=type=cache,target=/root/.m2,source=/cache/.m2,from=ghcr.io/scc-digitalhub/digitalhub-core:cache \ - mvn package -pl '!frontend' + mvn -Drevision=${VER} package -pl '!frontend' FROM maven:3-eclipse-temurin-21-alpine as builder WORKDIR /tmp @@ -28,4 +29,4 @@ COPY --from=builder /tmp/spring-boot-loader/ ./ COPY --from=builder /tmp/dh-dependencies/ ./ COPY --from=builder /tmp/application/ ./ EXPOSE 8080 -ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"] \ No newline at end of file +ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"]