From b111daf718a95854ce81214212620ba041515e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=20G=C3=B3mez?= Date: Mon, 13 Nov 2023 11:01:42 +0100 Subject: [PATCH] ci: add test server to run the tests --- Makefile | 4 ++-- docker-compose.yml | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 265df99..31dcc7c 100644 --- a/Makefile +++ b/Makefile @@ -7,13 +7,13 @@ build: @./gradlew build --warning-mode all lint: - @docker exec codely-java_ddd_example-mooc_backend_server ./gradlew spotlessCheck + @docker exec codely-java_ddd_example-test_server ./gradlew spotlessCheck run-tests: @./gradlew test --warning-mode all test: - @docker exec codely-java_ddd_example-mooc_backend_server ./gradlew test --warning-mode all + @docker exec codely-java_ddd_example-test_server ./gradlew test --warning-mode all run: @./gradlew :run diff --git a/docker-compose.yml b/docker-compose.yml index 25ca2bc..3da6fcb 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -91,7 +91,23 @@ services: - backoffice_elasticsearch command: ["./gradlew", "bootRun", "--args", "mooc_backend server"] + test_server_java: + container_name: codely-java_ddd_example-test_server + build: + context: . + dockerfile: Dockerfile + restart: unless-stopped + volumes: + - .:/app:delegated + - test_gradle_cache:/app/.gradle + depends_on: + - shared_mysql + - shared_rabbitmq + - backoffice_elasticsearch + tty: true + volumes: backoffice_backend_gradle_cache: backoffice_frontend_gradle_cache: mooc_backend_gradle_cache: + test_gradle_cache: