From fcd18e2022e24c9801e28a2ddfe462108faaa22d Mon Sep 17 00:00:00 2001 From: hamidonos Date: Fri, 27 Oct 2023 12:06:56 +0200 Subject: [PATCH] refactor: move http-request-logger-wrapper.yaml to test directory --- .../edc/samples/util/HttpRequestLoggerUtil.java | 2 +- .../samples/util/http-request-logger-wrapper.yaml | 13 +++++++++++++ transfer/transfer-02-consumer-pull/README.md | 3 ++- util/http-request-logger/Dockerfile | 4 +++- util/http-request-logger/docker-compose.yaml | 11 ----------- 5 files changed, 19 insertions(+), 14 deletions(-) create mode 100644 system-tests/src/test/java/org/eclipse/edc/samples/util/http-request-logger-wrapper.yaml delete mode 100644 util/http-request-logger/docker-compose.yaml diff --git a/system-tests/src/test/java/org/eclipse/edc/samples/util/HttpRequestLoggerUtil.java b/system-tests/src/test/java/org/eclipse/edc/samples/util/HttpRequestLoggerUtil.java index 23a55532..ef8d726c 100644 --- a/system-tests/src/test/java/org/eclipse/edc/samples/util/HttpRequestLoggerUtil.java +++ b/system-tests/src/test/java/org/eclipse/edc/samples/util/HttpRequestLoggerUtil.java @@ -22,7 +22,7 @@ public class HttpRequestLoggerUtil { - private static final String HTTP_REQUEST_LOGGER_DOCKER_COMPOSE_FILE_PATH = "util/http-request-logger/docker-compose.yaml"; + private static final String HTTP_REQUEST_LOGGER_DOCKER_COMPOSE_FILE_PATH = "system-tests/src/test/java/org/eclipse/edc/samples/util/http-request-logger-wrapper.yaml"; private static final String HTTP_REQUEST_LOGGER = "http-request-logger"; diff --git a/system-tests/src/test/java/org/eclipse/edc/samples/util/http-request-logger-wrapper.yaml b/system-tests/src/test/java/org/eclipse/edc/samples/util/http-request-logger-wrapper.yaml new file mode 100644 index 00000000..aa3aefbb --- /dev/null +++ b/system-tests/src/test/java/org/eclipse/edc/samples/util/http-request-logger-wrapper.yaml @@ -0,0 +1,13 @@ +# This wraps the http request logger container in the correct context (project root). +# Needed for test execution. + +version: "3.8" + +services: + http-request-logger: + image: http-request-logger + build: + context: ../../../../../../../../.. + dockerfile: util/http-request-logger/Dockerfile + ports: + - "4000:4000" \ No newline at end of file diff --git a/transfer/transfer-02-consumer-pull/README.md b/transfer/transfer-02-consumer-pull/README.md index dc5e7c15..145c1bfa 100644 --- a/transfer/transfer-02-consumer-pull/README.md +++ b/transfer/transfer-02-consumer-pull/README.md @@ -29,7 +29,8 @@ As a pre-requisite, you need to have a http server that runs on port 4000 and lo be mandatory to get the EndpointDataReference that will be used to get the data. ```bash -docker-compose -f util/http-request-logger/docker-compose.yaml up --abort-on-container-exit +docker build -f util/http-request-logger/Dockerfile -t http-request-logger . +docker run -p 4000:4000 http-request-logger ``` ### 2. Start the transfer diff --git a/util/http-request-logger/Dockerfile b/util/http-request-logger/Dockerfile index 174388cb..87e6ed51 100644 --- a/util/http-request-logger/Dockerfile +++ b/util/http-request-logger/Dockerfile @@ -7,4 +7,6 @@ RUN gradle util:http-request-logger:build FROM openjdk:17-slim WORKDIR /app -COPY --from=build /home/gradle/project/util/http-request-logger/build/libs/http-request-logger.jar /app/http-request-logger.jar \ No newline at end of file +COPY --from=build /home/gradle/project/util/http-request-logger/build/libs/http-request-logger.jar /app/http-request-logger.jar + +CMD ["java","-jar","/app/http-request-logger.jar"] \ No newline at end of file diff --git a/util/http-request-logger/docker-compose.yaml b/util/http-request-logger/docker-compose.yaml deleted file mode 100644 index a8db06b6..00000000 --- a/util/http-request-logger/docker-compose.yaml +++ /dev/null @@ -1,11 +0,0 @@ -version: "3.8" - -services: - http-request-logger: - build: - context: ../.. - dockerfile: util/http-request-logger/Dockerfile - entrypoint: java - -jar /app/http-request-logger.jar - ports: - - "4000:4000" \ No newline at end of file