From 43f487e1a39b41a239c24dd651db974061a81a2b Mon Sep 17 00:00:00 2001 From: oxdjww Date: Wed, 30 Apr 2025 18:27:58 +0900 Subject: [PATCH 1/6] =?UTF-8?q?[TEST]=20Ci=20Cd=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/focussu/backend/test/TestController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/main/java/com/focussu/backend/test/TestController.java b/backend/src/main/java/com/focussu/backend/test/TestController.java index bca8018..111838c 100644 --- a/backend/src/main/java/com/focussu/backend/test/TestController.java +++ b/backend/src/main/java/com/focussu/backend/test/TestController.java @@ -61,6 +61,6 @@ public ResponseEntity> checkSecurity() { ) }) public ResponseEntity> checkHealth() { - return ResponseEntity.ok(Map.of("message", "SERVER IS HEALTHY")); + return ResponseEntity.ok(Map.of("message", "SERVER IS HEALTHY!")); } } From 78aacbb56624c1b747be8d9f63b159f921c20dd7 Mon Sep 17 00:00:00 2001 From: oxdjww Date: Wed, 30 Apr 2025 18:45:52 +0900 Subject: [PATCH 2/6] =?UTF-8?q?[TEST]=20Ci=20Cd=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 14dad5d..0188f13 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -12,6 +12,18 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: temurin + + - name: Grant permission to Gradle wrapper + run: chmod +x ./backend/gradlew + + - name: Build JAR with Gradle + run: ./backend/gradlew build -x test --no-daemon + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 From 1ea639d6ae9e2f090d8a89f936e8bc5e63c086a3 Mon Sep 17 00:00:00 2001 From: oxdjww Date: Wed, 30 Apr 2025 18:50:20 +0900 Subject: [PATCH 3/6] =?UTF-8?q?[TEST]=20Ci=20Cd=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 0188f13..d91188c 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -19,10 +19,12 @@ jobs: distribution: temurin - name: Grant permission to Gradle wrapper - run: chmod +x ./backend/gradlew + run: chmod +x ./gradlew + working-directory: ./backend - name: Build JAR with Gradle - run: ./backend/gradlew build -x test --no-daemon + run: ./gradlew build -x test --no-daemon + working-directory: ./backend - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 From 7d2db9c53c09466182fba33b44b38ebaf3179d06 Mon Sep 17 00:00:00 2001 From: oxdjww Date: Wed, 30 Apr 2025 19:02:12 +0900 Subject: [PATCH 4/6] =?UTF-8?q?[TEST]=20Ci=20Cd=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 2 +- .github/workflows/ci.yml | 2 +- backend/Dockerfile | 12 ++++-------- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index d91188c..7cc2dd6 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -22,7 +22,7 @@ jobs: run: chmod +x ./gradlew working-directory: ./backend - - name: Build JAR with Gradle + - name: Build JAR without tests run: ./gradlew build -x test --no-daemon working-directory: ./backend diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 177a381..47c7d3b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,5 +25,5 @@ jobs: - name: Grant execute permission to Gradle wrapper run: chmod +x gradlew - - name: Build without tests + - name: Build JAR without tests run: ./gradlew build -x test --no-daemon diff --git a/backend/Dockerfile b/backend/Dockerfile index 8c9d99a..012449f 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,14 +1,10 @@ # backend/Dockerfile -# --- Stage 1: Build the JAR using Gradle --- -FROM gradle:7.6.0-jdk17 AS builder -WORKDIR /app -COPY . . -RUN gradle clean build -x test --no-daemon - -# --- Stage 2: Run the app using OpenJDK --- FROM openjdk:17-slim WORKDIR /app -COPY --from=builder /app/build/libs/*.jar app.jar + +# CI에서 빌드된 JAR을 그대로 사용 +COPY build/libs/*.jar app.jar + EXPOSE 80 ENTRYPOINT ["java", "-jar", "app.jar"] From b946ced2748330f09a3cdfa729ac5e0da841057b Mon Sep 17 00:00:00 2001 From: oxdjww Date: Wed, 30 Apr 2025 19:09:50 +0900 Subject: [PATCH 5/6] =?UTF-8?q?[TEST]=20Ci=20Cd=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 4 ++-- .github/workflows/ci.yml | 4 ++-- backend/Dockerfile | 9 ++------- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 7cc2dd6..445c30f 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -22,7 +22,7 @@ jobs: run: chmod +x ./gradlew working-directory: ./backend - - name: Build JAR without tests + - name: Build JAR with Gradle run: ./gradlew build -x test --no-daemon working-directory: ./backend @@ -41,7 +41,7 @@ jobs: - name: Build Docker image run: | - docker build -t focussu-backend:latest ./backend + docker build -t focussu-backend:latest . docker tag focussu-backend:latest ${{ secrets.ECR_REPO_URI }}:latest - name: Push Docker image diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 47c7d3b..fc125eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,8 +22,8 @@ jobs: java-version: 17 distribution: temurin - - name: Grant execute permission to Gradle wrapper + - name: Grant permission to Gradle wrapper run: chmod +x gradlew - - name: Build JAR without tests + - name: Build without tests run: ./gradlew build -x test --no-daemon diff --git a/backend/Dockerfile b/backend/Dockerfile index 012449f..9852b4d 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,10 +1,5 @@ -# backend/Dockerfile - FROM openjdk:17-slim WORKDIR /app - -# CI에서 빌드된 JAR을 그대로 사용 -COPY build/libs/*.jar app.jar - +COPY ./backend/build/libs/*.jar app.jar EXPOSE 80 -ENTRYPOINT ["java", "-jar", "app.jar"] +ENTRYPOINT ["java", "-jar", "app.jar"] \ No newline at end of file From fbc67c6f76cf311d91a6a0f7d8b307b11662c657 Mon Sep 17 00:00:00 2001 From: oxdjww Date: Wed, 30 Apr 2025 19:13:29 +0900 Subject: [PATCH 6/6] =?UTF-8?q?[TEST]=20Ci=20Cd=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 445c30f..e9cfadf 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -41,7 +41,7 @@ jobs: - name: Build Docker image run: | - docker build -t focussu-backend:latest . + docker build -t focussu-backend:latest -f ./backend/Dockerfile . docker tag focussu-backend:latest ${{ secrets.ECR_REPO_URI }}:latest - name: Push Docker image