From e932b0f9b8aff49d9bfd78440bc693397b00c16c Mon Sep 17 00:00:00 2001 From: Fiete Ostkamp Date: Mon, 15 May 2023 07:35:26 +0000 Subject: Switch bff docker base image Issue-ID: PORTALNG-1 Signed-off-by: Fiete Ostkamp Change-Id: I7afde9193743e42851e698a1f826883e2c8161d7 --- Dockerfile | 20 ++++---------------- .../portal/bff/users/CreateUserIntegrationTest.java | 2 +- lib/build.gradle | 1 + 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3e2f704..beafabd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,11 @@ -FROM openjdk:17 as builder +FROM eclipse-temurin:17 as builder COPY . ./portalbff WORKDIR /portalbff -# assemble does not run tests (as opposed to build) -RUN ./gradlew assemble +RUN ./gradlew build -# Run locally (docker build --target=prod -t .) -FROM openjdk:17 as prod +FROM eclipse-temurin:17-jre-alpine ARG JAR_FILE=/portalbff/app/build/libs/app.jar COPY --from=builder ${JAR_FILE} app.jar EXPOSE 9080 -ENTRYPOINT [ "java","-jar","app.jar" ] - -# Run in pipeline (docker build --target=pipeline -t .) -FROM openjdk:17 as pipeline -WORKDIR /app - -ARG JAR_FILE=app/build/libs/app.jar -COPY ${JAR_FILE} app.jar - -ENTRYPOINT [ "java","-jar","app.jar" ] -EXPOSE 9080 \ No newline at end of file +ENTRYPOINT [ "java","-jar","app.jar" ] \ No newline at end of file diff --git a/app/src/test/java/org/onap/portal/bff/users/CreateUserIntegrationTest.java b/app/src/test/java/org/onap/portal/bff/users/CreateUserIntegrationTest.java index 641724e..4e752aa 100644 --- a/app/src/test/java/org/onap/portal/bff/users/CreateUserIntegrationTest.java +++ b/app/src/test/java/org/onap/portal/bff/users/CreateUserIntegrationTest.java @@ -78,7 +78,7 @@ class CreateUserIntegrationTest extends BaseIntegrationTest { .accept(MediaType.APPLICATION_JSON_VALUE) .header(new Header("X-Request-Id", xRequestID)) .when() - .get(String.format("/users/%s/roles", userId)) + .get("/users/{id}/roles", userId) .then() .statusCode(HttpStatus.OK.value()) .extract() diff --git a/lib/build.gradle b/lib/build.gradle index 0e2a413..19e9e72 100644 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -67,6 +67,7 @@ spotless { target project.fileTree(project.projectDir) { include '**/*.java' exclude '**/build/**' + exclude '**/generated-sources/**' } removeUnusedImports() trimTrailingWhitespace() -- cgit 1.2.3-korg