From fd8ee358f1119fc6119db4846bcf43ec91af5f7b Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Mon, 24 Jun 2024 17:04:43 +0900 Subject: [PATCH 01/39] =?UTF-8?q?chore:=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev_deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index 0c2135e..7478243 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -84,7 +84,7 @@ jobs: source: ".github/scripts/deploy.sh" target: "/home/ec2-user/cicd" - # 배포 스크립트를 원격 서버에서 실행합니다. + # 배포 스크립트를 원격 서버에서 실행 - name: Execute deploy script uses: appleboy/ssh-action@master with: From 4947ef88985611c8786c2174bf9d16ff3ef94d2d Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Mon, 24 Jun 2024 17:15:04 +0900 Subject: [PATCH 02/39] =?UTF-8?q?chore:=20Copy=20jar=20file=20to=20remote?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev_deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index 7478243..240dd88 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -72,6 +72,7 @@ jobs: source: "./build/libs/*.jar" target: "/home/ec2-user/cicd" strip_components: 2 + debug: true # 배포 스크립트를 원격 서버에 복사합니다. From 4400e180904b27e8f305bfceea1a2efa4fca675b Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Mon, 24 Jun 2024 17:27:47 +0900 Subject: [PATCH 03/39] =?UTF-8?q?chore:ssh=ED=82=A4=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev_deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index 240dd88..0c6da56 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -75,7 +75,7 @@ jobs: debug: true - # 배포 스크립트를 원격 서버에 복사합니다. + # 배포 스크립트를 원격 서버에 복사 - name: Copy deploy script file to remote uses: appleboy/scp-action@master with: From ed346fccdb5a682fe074b128c5787ecdf2429979 Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Mon, 24 Jun 2024 17:32:19 +0900 Subject: [PATCH 04/39] =?UTF-8?q?chore:ssh=ED=82=A4=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev_deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index 0c6da56..9ca436b 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -79,8 +79,8 @@ jobs: - name: Copy deploy script file to remote uses: appleboy/scp-action@master with: - username: ec2-user host: ${{ secrets.EC2_HOST }} + username: ubuntu key: ${{ secrets.EC2_SSH_KEY }} source: ".github/scripts/deploy.sh" target: "/home/ec2-user/cicd" @@ -89,8 +89,8 @@ jobs: - name: Execute deploy script uses: appleboy/ssh-action@master with: - username: ec2-user host: ${{ secrets.EC2_HOST }} + username: ubuntu key: ${{ secrets.EC2_SSH_KEY }} script_stop: true script: | From 30788f5d4ed4ba4eeae16a4d4627f918bcd4d71e Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Mon, 24 Jun 2024 17:34:25 +0900 Subject: [PATCH 05/39] =?UTF-8?q?chore:username=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev_deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index 9ca436b..f9f563a 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -66,8 +66,8 @@ jobs: - name: Copy jar file to remote uses: appleboy/scp-action@master with: - username: ec2-user host: ${{ secrets.EC2_HOST }} + username: ubuntu key: ${{ secrets.EC2_SSH_KEY }} source: "./build/libs/*.jar" target: "/home/ec2-user/cicd" From d7f58e0aa79fb3395905590d3680a5a6abd88cd4 Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Mon, 24 Jun 2024 17:45:36 +0900 Subject: [PATCH 06/39] =?UTF-8?q?chore:username=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev_deploy.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index f9f563a..8276914 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -70,7 +70,7 @@ jobs: username: ubuntu key: ${{ secrets.EC2_SSH_KEY }} source: "./build/libs/*.jar" - target: "/home/ec2-user/cicd" + target: "/home/ubuntu/cicd" strip_components: 2 debug: true @@ -83,7 +83,7 @@ jobs: username: ubuntu key: ${{ secrets.EC2_SSH_KEY }} source: ".github/scripts/deploy.sh" - target: "/home/ec2-user/cicd" + target: "/home/ubuntu/cicd" # 배포 스크립트를 원격 서버에서 실행 - name: Execute deploy script @@ -94,8 +94,8 @@ jobs: key: ${{ secrets.EC2_SSH_KEY }} script_stop: true script: | - chmod +x /home/ec2-user/cicd/deploy.sh - sh /home/ec2-user/cicd/deploy.sh + chmod +x /home/ubuntu/cicd/deploy.sh + sh /home/ubuntu/cicd/deploy.sh From 47ad75b56ed1e2531452590ce3862cb2fb59635d Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Mon, 24 Jun 2024 17:59:17 +0900 Subject: [PATCH 07/39] =?UTF-8?q?chore:username=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev_deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index 8276914..b09ac67 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -82,7 +82,7 @@ jobs: host: ${{ secrets.EC2_HOST }} username: ubuntu key: ${{ secrets.EC2_SSH_KEY }} - source: ".github/scripts/deploy.sh" + source: ".github/script/deploy.sh" target: "/home/ubuntu/cicd" # 배포 스크립트를 원격 서버에서 실행 From 2a26e8692df9fc396beb6277c2ffca94e490f0bb Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Mon, 24 Jun 2024 18:16:52 +0900 Subject: [PATCH 08/39] =?UTF-8?q?chore:=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev_deploy.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index b09ac67..c2d6cb4 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -46,6 +46,12 @@ jobs: - name: Build With Gradle run: ./gradlew build -x test + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: cicdsample + path: build/libs/*.jar + # Docker 이미지를 빌드합니다. - name: docker image build run: docker build -t qormoon/fiurinee_docker . From 94483cd4176bb7c50c59a233550c0b7bb3eaa1e2 Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Mon, 24 Jun 2024 18:23:42 +0900 Subject: [PATCH 09/39] =?UTF-8?q?chore:=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev_deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index c2d6cb4..ed96fd7 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -88,7 +88,7 @@ jobs: host: ${{ secrets.EC2_HOST }} username: ubuntu key: ${{ secrets.EC2_SSH_KEY }} - source: ".github/script/deploy.sh" + source: "deploy.sh" target: "/home/ubuntu/cicd" # 배포 스크립트를 원격 서버에서 실행 From 55045078ff918c5d6c47219b8b0c5bf5b2dd429f Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Mon, 24 Jun 2024 18:28:59 +0900 Subject: [PATCH 10/39] =?UTF-8?q?chore:=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- {.github/script => .deploy}/deploy.sh | 0 .github/workflows/dev_deploy.yml | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename {.github/script => .deploy}/deploy.sh (100%) diff --git a/.github/script/deploy.sh b/.deploy/deploy.sh similarity index 100% rename from .github/script/deploy.sh rename to .deploy/deploy.sh diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index ed96fd7..aa14468 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -88,7 +88,7 @@ jobs: host: ${{ secrets.EC2_HOST }} username: ubuntu key: ${{ secrets.EC2_SSH_KEY }} - source: "deploy.sh" + source: "./deploy/deploy.sh" target: "/home/ubuntu/cicd" # 배포 스크립트를 원격 서버에서 실행 From 11a8015ba6f7f982fdd392ad380b3715d593b521 Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Mon, 24 Jun 2024 18:44:31 +0900 Subject: [PATCH 11/39] =?UTF-8?q?chore:=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev_deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index aa14468..242300f 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -88,7 +88,7 @@ jobs: host: ${{ secrets.EC2_HOST }} username: ubuntu key: ${{ secrets.EC2_SSH_KEY }} - source: "./deploy/deploy.sh" + source: "./.deploy/deploy.sh" target: "/home/ubuntu/cicd" # 배포 스크립트를 원격 서버에서 실행 From cc27d5befdf212b2fdb645f593bc1bb2ad2dae2c Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Mon, 24 Jun 2024 18:59:00 +0900 Subject: [PATCH 12/39] =?UTF-8?q?chore:=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev_deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index 242300f..79114f1 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -90,6 +90,7 @@ jobs: key: ${{ secrets.EC2_SSH_KEY }} source: "./.deploy/deploy.sh" target: "/home/ubuntu/cicd" + debug: true # 배포 스크립트를 원격 서버에서 실행 - name: Execute deploy script From 1df261b31207a51f6c7830434d2ec579d45a25fe Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Mon, 24 Jun 2024 19:28:15 +0900 Subject: [PATCH 13/39] =?UTF-8?q?chore:=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev_deploy.yml | 57 ++++---------------------------- 1 file changed, 7 insertions(+), 50 deletions(-) diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index 79114f1..6e06da4 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -46,11 +46,6 @@ jobs: - name: Build With Gradle run: ./gradlew build -x test - - name: Upload artifact - uses: actions/upload-artifact@v2 - with: - name: cicdsample - path: build/libs/*.jar # Docker 이미지를 빌드합니다. - name: docker image build @@ -68,57 +63,19 @@ jobs: run: docker push qormoon/fiurinee_docker - # 빌드된 JAR 파일을 원격 서버에 복사합니다. - - name: Copy jar file to remote - uses: appleboy/scp-action@master - with: - host: ${{ secrets.EC2_HOST }} - username: ubuntu - key: ${{ secrets.EC2_SSH_KEY }} - source: "./build/libs/*.jar" - target: "/home/ubuntu/cicd" - strip_components: 2 - debug: true - - - # 배포 스크립트를 원격 서버에 복사 - - name: Copy deploy script file to remote - uses: appleboy/scp-action@master - with: - host: ${{ secrets.EC2_HOST }} - username: ubuntu - key: ${{ secrets.EC2_SSH_KEY }} - source: "./.deploy/deploy.sh" - target: "/home/ubuntu/cicd" - debug: true - - # 배포 스크립트를 원격 서버에서 실행 - - name: Execute deploy script + # 배포 + - name: Deploy uses: appleboy/ssh-action@master with: host: ${{ secrets.EC2_HOST }} username: ubuntu key: ${{ secrets.EC2_SSH_KEY }} - script_stop: true + envs: GITHUB_SHA script: | - chmod +x /home/ubuntu/cicd/deploy.sh - sh /home/ubuntu/cicd/deploy.sh - - - -# # 배포 -# - name: Deploy -# uses: appleboy/ssh-action@master -# with: -# host: ${{ secrets.EC2_HOST }} -# username: ubuntu -# key: ${{ secrets.EC2_SSH_KEY }} -# envs: GITHUB_SHA -# script: | -# sudo docker ps -# sudo docker pull qormoon/fiurinee_docker -# sudo docker run -d -p 8080:8080 qormoon/fiurinee_docker -# sudo docker image prune -f + sudo docker ps + sudo docker pull qormoon/fiurinee_docker + sudo docker run -d -p 8080:8080 qormoon/fiurinee_docker + sudo docker image prune -f # # 새로 빌드된 Docker 이미지를 EC2 서버에 배포하는 작업을 정의합니다. # deploy: From ff9d977d9f26101e9527f3a092018ca05c9b1dfa Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Mon, 24 Jun 2024 19:57:29 +0900 Subject: [PATCH 14/39] =?UTF-8?q?chore:=20ci-cd=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/anniversary/controller/api/AnniversaryApi.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/example/fiurinee/domain/anniversary/controller/api/AnniversaryApi.java b/src/main/java/com/example/fiurinee/domain/anniversary/controller/api/AnniversaryApi.java index 10a20d5..49a9b2d 100644 --- a/src/main/java/com/example/fiurinee/domain/anniversary/controller/api/AnniversaryApi.java +++ b/src/main/java/com/example/fiurinee/domain/anniversary/controller/api/AnniversaryApi.java @@ -34,7 +34,7 @@ public interface AnniversaryApi { @ApiResponse(responseCode = "401", description = "인증 실패") @ApiResponse(responseCode = "404", description = "사용자를 찾을 수 없음") @PostMapping("/member/{id}/anniversary") - ResponseEntity addAnniversary(@PathVariable Long id, @RequestBody AnniversaryRequestDTO request); + ResponseEntity addAnniversary(@Parameter(name = "id", description = "멤버아이디")@PathVariable Long id, @RequestBody AnniversaryRequestDTO request); @Operation( summary = "기념일 수정", From a2bb2884664d645fbc5bb636b218e304fc606510 Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Mon, 24 Jun 2024 19:59:54 +0900 Subject: [PATCH 15/39] =?UTF-8?q?chore:=20ci-cd=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/anniversary/controller/api/AnniversaryApi.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/example/fiurinee/domain/anniversary/controller/api/AnniversaryApi.java b/src/main/java/com/example/fiurinee/domain/anniversary/controller/api/AnniversaryApi.java index 49a9b2d..0e47cd8 100644 --- a/src/main/java/com/example/fiurinee/domain/anniversary/controller/api/AnniversaryApi.java +++ b/src/main/java/com/example/fiurinee/domain/anniversary/controller/api/AnniversaryApi.java @@ -37,7 +37,7 @@ public interface AnniversaryApi { ResponseEntity addAnniversary(@Parameter(name = "id", description = "멤버아이디")@PathVariable Long id, @RequestBody AnniversaryRequestDTO request); @Operation( - summary = "기념일 수정", + summary = "기념일 수정입니닷", description = "사용자의 기념일을 수정합니다.", security = @SecurityRequirement(name = "bearerAuth") ) From 7afa2a364754d30a16d514a63aa6cae287758849 Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Mon, 24 Jun 2024 20:09:02 +0900 Subject: [PATCH 16/39] =?UTF-8?q?chore:=20ci-cd=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/anniversary/controller/api/AnniversaryApi.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/example/fiurinee/domain/anniversary/controller/api/AnniversaryApi.java b/src/main/java/com/example/fiurinee/domain/anniversary/controller/api/AnniversaryApi.java index 0e47cd8..1111267 100644 --- a/src/main/java/com/example/fiurinee/domain/anniversary/controller/api/AnniversaryApi.java +++ b/src/main/java/com/example/fiurinee/domain/anniversary/controller/api/AnniversaryApi.java @@ -37,7 +37,7 @@ public interface AnniversaryApi { ResponseEntity addAnniversary(@Parameter(name = "id", description = "멤버아이디")@PathVariable Long id, @RequestBody AnniversaryRequestDTO request); @Operation( - summary = "기념일 수정입니닷", + summary = "기념일 수정입니닷닷", description = "사용자의 기념일을 수정합니다.", security = @SecurityRequirement(name = "bearerAuth") ) From c5a4d0872a926d51587eb49aa847f77913643cf3 Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Mon, 24 Jun 2024 20:14:20 +0900 Subject: [PATCH 17/39] =?UTF-8?q?chore:=20ci-cd=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/anniversary/controller/api/AnniversaryApi.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/example/fiurinee/domain/anniversary/controller/api/AnniversaryApi.java b/src/main/java/com/example/fiurinee/domain/anniversary/controller/api/AnniversaryApi.java index 1111267..3b5d058 100644 --- a/src/main/java/com/example/fiurinee/domain/anniversary/controller/api/AnniversaryApi.java +++ b/src/main/java/com/example/fiurinee/domain/anniversary/controller/api/AnniversaryApi.java @@ -37,7 +37,7 @@ public interface AnniversaryApi { ResponseEntity addAnniversary(@Parameter(name = "id", description = "멤버아이디")@PathVariable Long id, @RequestBody AnniversaryRequestDTO request); @Operation( - summary = "기념일 수정입니닷닷", + summary = "기념일 수정입니당", description = "사용자의 기념일을 수정합니다.", security = @SecurityRequirement(name = "bearerAuth") ) From 6cf6103340a555e7974dbb6634229c7131dc6d92 Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Mon, 24 Jun 2024 20:25:06 +0900 Subject: [PATCH 18/39] =?UTF-8?q?chore:=20ci-cd=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/anniversary/controller/api/AnniversaryApi.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/example/fiurinee/domain/anniversary/controller/api/AnniversaryApi.java b/src/main/java/com/example/fiurinee/domain/anniversary/controller/api/AnniversaryApi.java index 3b5d058..0e47cd8 100644 --- a/src/main/java/com/example/fiurinee/domain/anniversary/controller/api/AnniversaryApi.java +++ b/src/main/java/com/example/fiurinee/domain/anniversary/controller/api/AnniversaryApi.java @@ -37,7 +37,7 @@ public interface AnniversaryApi { ResponseEntity addAnniversary(@Parameter(name = "id", description = "멤버아이디")@PathVariable Long id, @RequestBody AnniversaryRequestDTO request); @Operation( - summary = "기념일 수정입니당", + summary = "기념일 수정입니닷", description = "사용자의 기념일을 수정합니다.", security = @SecurityRequirement(name = "bearerAuth") ) From 4e791c05f2f33f1cb6c42b2230a9020495a0ae8d Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Mon, 24 Jun 2024 20:33:44 +0900 Subject: [PATCH 19/39] =?UTF-8?q?chore:=20ci-cd=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev_deploy.yml | 80 ++++++++++++++++---------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index 6e06da4..db68502 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -63,48 +63,48 @@ jobs: run: docker push qormoon/fiurinee_docker - # 배포 - - name: Deploy - uses: appleboy/ssh-action@master - with: - host: ${{ secrets.EC2_HOST }} - username: ubuntu - key: ${{ secrets.EC2_SSH_KEY }} - envs: GITHUB_SHA - script: | - sudo docker ps - sudo docker pull qormoon/fiurinee_docker - sudo docker run -d -p 8080:8080 qormoon/fiurinee_docker - sudo docker image prune -f - -# # 새로 빌드된 Docker 이미지를 EC2 서버에 배포하는 작업을 정의합니다. -# deploy: -# needs: build-docker-image # build-docker-image 작업이 완료된 후에 실행됩니다. -# runs-on: ubuntu-latest # 워크플로우가 실행될 환경을 지정합니다. -# -# steps: -# # EC2 서버에 SSH로 접속하여 Docker 이미지를 pull하고 컨테이너를 재시작 -# - name: Deploy to EC2 +# # 배포 +# - name: Deploy # uses: appleboy/ssh-action@master # with: -# host: ${{ secrets.EC2_HOST }} # EC2 서버의 호스트 주소 +# host: ${{ secrets.EC2_HOST }} # username: ubuntu -# key: ${{ secrets.EC2_SSH_KEY }} # EC2 서버에 접근하기 위한 SSH 개인 키 +# key: ${{ secrets.EC2_SSH_KEY }} +# envs: GITHUB_SHA # script: | -# # Docker Hub에서 최신 이미지를 pull 합니다. +# sudo docker ps # sudo docker pull qormoon/fiurinee_docker -# # 기존 컨테이너를 중지합니다. -# sudo docker stop fiurinee || true -# # 기존 컨테이너를 제거합니다. -# sudo docker rm fiurinee || true -# # 새 컨테이너를 실행하면서 환경 변수를 전달합니다. -# sudo docker run -d -p 8080:8080 --name fiurinee \ -# -e DB_URL=jdbc:postgresql://database-fiurinee.czyqweykwib4.ap-northeast-2.rds.amazonaws.com:5432/fiurinee \ -# -e DB_USERNAME=${{ secrets.DB_USERNAME }} \ -# -e DB_PASSWORD=${{ secrets.DB_PASSWORD }} \ -# -e AWS_ACCESSKEY=${{ secrets.AWS_ACCESSKEY }} \ -# -e AWS_SECRETKEY=${{ secrets.AWS_SECRETKEY }} \ -# -e AWS_BUCKET=${{ secrets.AWS_BUCKET }} \ -# -e hibernate_ddl_auto=update \ -# -v fiurinee_data:/var/lib/postgresql/data \ -# qormoon/fiurinee_docker +# sudo docker run -d -p 8080:8080 qormoon/fiurinee_docker +# sudo docker image prune -f + + # 새로 빌드된 Docker 이미지를 EC2 서버에 배포하는 작업을 정의 + deploy: + needs: build-docker-image # build-docker-image 작업이 완료된 후에 실행됩니다. + runs-on: ubuntu-latest # 워크플로우가 실행될 환경을 지정합니다. + + steps: + # EC2 서버에 SSH로 접속하여 Docker 이미지를 pull하고 컨테이너를 재시작 + - name: Deploy to EC2 + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.EC2_HOST }} # EC2 서버의 호스트 주소 + username: ubuntu + key: ${{ secrets.EC2_SSH_KEY }} # EC2 서버에 접근하기 위한 SSH 개인 키 + script: | + # Docker Hub에서 최신 이미지를 pull 합니다. + sudo docker pull qormoon/fiurinee_docker + # 기존 컨테이너를 중지합니다. + sudo docker stop fiurinee || true + # 기존 컨테이너를 제거합니다. + sudo docker rm fiurinee || true + # 새 컨테이너를 실행하면서 환경 변수를 전달합니다. + sudo docker run -d -p 8080:8080 --name fiurinee \ + -e DB_URL=jdbc:postgresql://database-fiurinee.czyqweykwib4.ap-northeast-2.rds.amazonaws.com:5432/fiurinee \ + -e DB_USERNAME=${{ secrets.DB_USERNAME }} \ + -e DB_PASSWORD=${{ secrets.DB_PASSWORD }} \ + -e AWS_ACCESSKEY=${{ secrets.AWS_ACCESSKEY }} \ + -e AWS_SECRETKEY=${{ secrets.AWS_SECRETKEY }} \ + -e AWS_BUCKET=${{ secrets.AWS_BUCKET }} \ + -e hibernate_ddl_auto=update \ + -v fiurinee_data:/var/lib/postgresql/data \ + qormoon/fiurinee_docker From 6fc3aebf96853db7a3f1f9a51e12acac1b9382e3 Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Mon, 24 Jun 2024 20:36:44 +0900 Subject: [PATCH 20/39] =?UTF-8?q?chore:=20ci-cd=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/anniversary/controller/api/AnniversaryApi.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/example/fiurinee/domain/anniversary/controller/api/AnniversaryApi.java b/src/main/java/com/example/fiurinee/domain/anniversary/controller/api/AnniversaryApi.java index 0e47cd8..49a9b2d 100644 --- a/src/main/java/com/example/fiurinee/domain/anniversary/controller/api/AnniversaryApi.java +++ b/src/main/java/com/example/fiurinee/domain/anniversary/controller/api/AnniversaryApi.java @@ -37,7 +37,7 @@ public interface AnniversaryApi { ResponseEntity addAnniversary(@Parameter(name = "id", description = "멤버아이디")@PathVariable Long id, @RequestBody AnniversaryRequestDTO request); @Operation( - summary = "기념일 수정입니닷", + summary = "기념일 수정", description = "사용자의 기념일을 수정합니다.", security = @SecurityRequirement(name = "bearerAuth") ) From e98d4d412ecf1d47e43617e5fb464a221356d230 Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Mon, 24 Jun 2024 22:46:24 +0900 Subject: [PATCH 21/39] =?UTF-8?q?chore:=20redis=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .deploy/docker-compose.yml | 24 +++++++++++++ .github/workflows/dev_deploy.yml | 55 ++++++++++++++---------------- src/main/resources/application.yml | 2 +- 3 files changed, 50 insertions(+), 31 deletions(-) create mode 100644 .deploy/docker-compose.yml diff --git a/.deploy/docker-compose.yml b/.deploy/docker-compose.yml new file mode 100644 index 0000000..a58edc4 --- /dev/null +++ b/.deploy/docker-compose.yml @@ -0,0 +1,24 @@ +version: '3.8' + +services: + app: + image: qormoon/fiurinee_docker + ports: + - "8080:8080" + environment: + DB_URL: ${DB_URL} + DB_USERNAME: ${DB_USERNAME} + DB_PASSWORD: ${DB_PASSWORD} + AWS_ACCESSKEY: ${AWS_ACCESSKEY} + AWS_SECRETKEY: ${AWS_SECRETKEY} + AWS_BUCKET: ${AWS_BUCKET} + hibernate_ddl_auto: update + REDIS_HOST: redis + depends_on: + - redis + + redis: + image: "redis:latest" + ports: + - "6379:6379" + diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index db68502..d678fcb 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -63,19 +63,6 @@ jobs: run: docker push qormoon/fiurinee_docker -# # 배포 -# - name: Deploy -# uses: appleboy/ssh-action@master -# with: -# host: ${{ secrets.EC2_HOST }} -# username: ubuntu -# key: ${{ secrets.EC2_SSH_KEY }} -# envs: GITHUB_SHA -# script: | -# sudo docker ps -# sudo docker pull qormoon/fiurinee_docker -# sudo docker run -d -p 8080:8080 qormoon/fiurinee_docker -# sudo docker image prune -f # 새로 빌드된 Docker 이미지를 EC2 서버에 배포하는 작업을 정의 deploy: @@ -91,20 +78,28 @@ jobs: username: ubuntu key: ${{ secrets.EC2_SSH_KEY }} # EC2 서버에 접근하기 위한 SSH 개인 키 script: | - # Docker Hub에서 최신 이미지를 pull 합니다. - sudo docker pull qormoon/fiurinee_docker - # 기존 컨테이너를 중지합니다. - sudo docker stop fiurinee || true - # 기존 컨테이너를 제거합니다. - sudo docker rm fiurinee || true - # 새 컨테이너를 실행하면서 환경 변수를 전달합니다. - sudo docker run -d -p 8080:8080 --name fiurinee \ - -e DB_URL=jdbc:postgresql://database-fiurinee.czyqweykwib4.ap-northeast-2.rds.amazonaws.com:5432/fiurinee \ - -e DB_USERNAME=${{ secrets.DB_USERNAME }} \ - -e DB_PASSWORD=${{ secrets.DB_PASSWORD }} \ - -e AWS_ACCESSKEY=${{ secrets.AWS_ACCESSKEY }} \ - -e AWS_SECRETKEY=${{ secrets.AWS_SECRETKEY }} \ - -e AWS_BUCKET=${{ secrets.AWS_BUCKET }} \ - -e hibernate_ddl_auto=update \ - -v fiurinee_data:/var/lib/postgresql/data \ - qormoon/fiurinee_docker + sudo apt-get update + sudo apt-get install -y docker-compose + echo "$DB_USERNAME=$DB_USERNAME" > .env + echo "$DB_PASSWORD=$DB_PASSWORD" >> .env + echo "$AWS_ACCESSKEY=$AWS_ACCESSKEY" >> .env + echo "$AWS_SECRETKEY=$AWS_SECRETKEY" >> .env + echo "$AWS_BUCKET=$AWS_BUCKET" >> .env + sudo docker-compose -f /path/to/docker-compose.yml pull + sudo docker-compose -f /path/to/docker-compose.yml up -d + sudo docker image prune -f + + +# # 배포 +# - name: Deploy +# uses: appleboy/ssh-action@master +# with: +# host: ${{ secrets.EC2_HOST }} +# username: ubuntu +# key: ${{ secrets.EC2_SSH_KEY }} +# envs: GITHUB_SHA +# script: | +# sudo docker ps +# sudo docker pull qormoon/fiurinee_docker +# sudo docker run -d -p 8080:8080 qormoon/fiurinee_docker +# sudo docker image prune -f diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index e5e31ad..5b59825 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -33,7 +33,7 @@ spring: client-id: ${KAKAO_CLIENT_ID} client-secret: ${KAKAO_CLIENT_SECRET} client-authentication-method: client_secret_post - redirect-uri: http://3.36.169.209:8080/login/oauth2/code/kakao + redirect-uri: http://localhost:8080/oauth2/authorization/kakao authorization-grant-type: authorization_code client-name: kakao scope: From 325dca67337bbfc9cb8bc5292f61ad02013119da Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Mon, 24 Jun 2024 23:37:44 +0900 Subject: [PATCH 22/39] =?UTF-8?q?chore:=20redis=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev_deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index d678fcb..59027f6 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -85,8 +85,8 @@ jobs: echo "$AWS_ACCESSKEY=$AWS_ACCESSKEY" >> .env echo "$AWS_SECRETKEY=$AWS_SECRETKEY" >> .env echo "$AWS_BUCKET=$AWS_BUCKET" >> .env - sudo docker-compose -f /path/to/docker-compose.yml pull - sudo docker-compose -f /path/to/docker-compose.yml up -d + sudo docker-compose -f .deploy/docker-compose.yml pull + sudo docker-compose -f .deploy/docker-compose.yml up -d sudo docker image prune -f From b3c5666267a9c6f2613b3f07c83c580bdf1c681b Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Tue, 25 Jun 2024 00:20:06 +0900 Subject: [PATCH 23/39] Update dev_deploy.yml workflow --- .github/workflows/dev_deploy.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index 59027f6..2f44a88 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -70,6 +70,15 @@ jobs: runs-on: ubuntu-latest # 워크플로우가 실행될 환경을 지정합니다. steps: + - name: Copy docker-compose.yml + uses: appleboy/scp-action@master + with: + host: ${{ secrets.EC2_HOST }} + username: ubuntu + key: ${{ secrets.EC2_SSH_KEY }} + source: ".deploy/docker-compose.yml" + target: "/home/ubuntu/.deploy/" + # EC2 서버에 SSH로 접속하여 Docker 이미지를 pull하고 컨테이너를 재시작 - name: Deploy to EC2 uses: appleboy/ssh-action@master @@ -80,11 +89,11 @@ jobs: script: | sudo apt-get update sudo apt-get install -y docker-compose - echo "$DB_USERNAME=$DB_USERNAME" > .env - echo "$DB_PASSWORD=$DB_PASSWORD" >> .env - echo "$AWS_ACCESSKEY=$AWS_ACCESSKEY" >> .env - echo "$AWS_SECRETKEY=$AWS_SECRETKEY" >> .env - echo "$AWS_BUCKET=$AWS_BUCKET" >> .env + echo "DB_USERNAME=${{ secrets.DB_USERNAME }}" > .env + echo "DB_PASSWORD=${{ secrets.DB_PASSWORD }}" >> .env + echo "AWS_ACCESSKEY=${{ secrets.AWS_ACCESSKEY }}" >> .env + echo "AWS_SECRETKEY=${{ secrets.AWS_SECRETKEY }}" >> .env + echo "AWS_BUCKET=${{ secrets.AWS_BUCKET }}" >> .env sudo docker-compose -f .deploy/docker-compose.yml pull sudo docker-compose -f .deploy/docker-compose.yml up -d sudo docker image prune -f From 4261c0a36b6c16aab17b5d5e2abd52d353042580 Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Tue, 25 Jun 2024 00:26:41 +0900 Subject: [PATCH 24/39] =?UTF-8?q?chore:compose=20=EC=9C=84=EC=B9=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev_deploy.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index 2f44a88..e2b3db1 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -47,6 +47,16 @@ jobs: run: ./gradlew build -x test + - name: Copy docker-compose.yml + uses: appleboy/scp-action@master + with: + host: ${{ secrets.EC2_HOST }} + username: ubuntu + key: ${{ secrets.EC2_SSH_KEY }} + source: ".deploy/docker-compose.yml" + target: "/home/ubuntu/.deploy/" + + # Docker 이미지를 빌드합니다. - name: docker image build run: docker build -t qormoon/fiurinee_docker . @@ -70,14 +80,6 @@ jobs: runs-on: ubuntu-latest # 워크플로우가 실행될 환경을 지정합니다. steps: - - name: Copy docker-compose.yml - uses: appleboy/scp-action@master - with: - host: ${{ secrets.EC2_HOST }} - username: ubuntu - key: ${{ secrets.EC2_SSH_KEY }} - source: ".deploy/docker-compose.yml" - target: "/home/ubuntu/.deploy/" # EC2 서버에 SSH로 접속하여 Docker 이미지를 pull하고 컨테이너를 재시작 - name: Deploy to EC2 From b32c2e4da20d31f1419dafd469ce84404b0d1c74 Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Tue, 25 Jun 2024 00:36:15 +0900 Subject: [PATCH 25/39] =?UTF-8?q?chore:=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev_deploy.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index e2b3db1..69d2a48 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -46,6 +46,15 @@ jobs: - name: Build With Gradle run: ./gradlew build -x test + - name: Create .deploy directory + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.EC2_HOST }} + username: ubuntu + key: ${{ secrets.EC2_SSH_KEY }} + script: | + mkdir -p /home/ubuntu/.deploy + - name: Copy docker-compose.yml uses: appleboy/scp-action@master From 2ad614b068ac3ed15b0e0b2bf40f22ceda8ed140 Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Tue, 25 Jun 2024 00:39:27 +0900 Subject: [PATCH 26/39] =?UTF-8?q?chore:=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev_deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index 69d2a48..8ea9cb2 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -46,14 +46,14 @@ jobs: - name: Build With Gradle run: ./gradlew build -x test - - name: Create .deploy directory + - name: Create deploy directory uses: appleboy/ssh-action@master with: host: ${{ secrets.EC2_HOST }} username: ubuntu key: ${{ secrets.EC2_SSH_KEY }} script: | - mkdir -p /home/ubuntu/.deploy + mkdir -p /home/ubuntu/deploy - name: Copy docker-compose.yml From d8672d24138e7e564aef3b83c441d82b504b146c Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Tue, 25 Jun 2024 00:41:38 +0900 Subject: [PATCH 27/39] =?UTF-8?q?chore:=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev_deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index 8ea9cb2..3124345 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -63,7 +63,7 @@ jobs: username: ubuntu key: ${{ secrets.EC2_SSH_KEY }} source: ".deploy/docker-compose.yml" - target: "/home/ubuntu/.deploy/" + target: "/home/ubuntu/deploy/" # Docker 이미지를 빌드합니다. From e4d4b5d800b3c69c349ded0cda09fca6af96cffa Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Tue, 25 Jun 2024 00:47:01 +0900 Subject: [PATCH 28/39] =?UTF-8?q?chore:docker-compose.yml=20=EC=9C=84?= =?UTF-8?q?=EC=B9=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev_deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index 3124345..d29d126 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -62,7 +62,7 @@ jobs: host: ${{ secrets.EC2_HOST }} username: ubuntu key: ${{ secrets.EC2_SSH_KEY }} - source: ".deploy/docker-compose.yml" + source: "docker-compose.yml" target: "/home/ubuntu/deploy/" From 8545f06d1ad32c7c9d533e181bf239fa3fc7435f Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Tue, 25 Jun 2024 00:50:35 +0900 Subject: [PATCH 29/39] =?UTF-8?q?chore:docker-compose.yml=20=EC=9C=84?= =?UTF-8?q?=EC=B9=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev_deploy.yml | 2 +- .deploy/docker-compose.yml => docker-compose.yml | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename .deploy/docker-compose.yml => docker-compose.yml (100%) diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index d29d126..a458d50 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -55,7 +55,7 @@ jobs: script: | mkdir -p /home/ubuntu/deploy - + # docker-compose 복사 - name: Copy docker-compose.yml uses: appleboy/scp-action@master with: diff --git a/.deploy/docker-compose.yml b/docker-compose.yml similarity index 100% rename from .deploy/docker-compose.yml rename to docker-compose.yml From f2cb56cba2931651f4e4efec7183b074f4751ebf Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Tue, 25 Jun 2024 00:53:24 +0900 Subject: [PATCH 30/39] =?UTF-8?q?chore:=EA=B2=BD=EB=A1=9C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev_deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index a458d50..ee39dd4 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -105,8 +105,8 @@ jobs: echo "AWS_ACCESSKEY=${{ secrets.AWS_ACCESSKEY }}" >> .env echo "AWS_SECRETKEY=${{ secrets.AWS_SECRETKEY }}" >> .env echo "AWS_BUCKET=${{ secrets.AWS_BUCKET }}" >> .env - sudo docker-compose -f .deploy/docker-compose.yml pull - sudo docker-compose -f .deploy/docker-compose.yml up -d + sudo docker-compose -f deploy/docker-compose.yml pull + sudo docker-compose -f deploy/docker-compose.yml up -d sudo docker image prune -f From dfb3718b1599edfe8c3ac3ce23a157683a63b1dd Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Tue, 25 Jun 2024 01:02:47 +0900 Subject: [PATCH 31/39] =?UTF-8?q?chore:env=20=EA=B2=BD=EB=A1=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev_deploy.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index ee39dd4..31f8ffc 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -100,13 +100,13 @@ jobs: script: | sudo apt-get update sudo apt-get install -y docker-compose - echo "DB_USERNAME=${{ secrets.DB_USERNAME }}" > .env - echo "DB_PASSWORD=${{ secrets.DB_PASSWORD }}" >> .env - echo "AWS_ACCESSKEY=${{ secrets.AWS_ACCESSKEY }}" >> .env - echo "AWS_SECRETKEY=${{ secrets.AWS_SECRETKEY }}" >> .env - echo "AWS_BUCKET=${{ secrets.AWS_BUCKET }}" >> .env - sudo docker-compose -f deploy/docker-compose.yml pull - sudo docker-compose -f deploy/docker-compose.yml up -d + echo "DB_USERNAME=${{ secrets.DB_USERNAME }}" > ~/deploy/.env + echo "DB_PASSWORD=${{ secrets.DB_PASSWORD }}" >> ~/deploy/.env + echo "AWS_ACCESSKEY=${{ secrets.AWS_ACCESSKEY }}" >> ~/deploy/.env + echo "AWS_SECRETKEY=${{ secrets.AWS_SECRETKEY }}" >> ~/deploy/.env + echo "AWS_BUCKET=${{ secrets.AWS_BUCKET }}" >> ~/deploy/.env + sudo docker-compose -f ~/deploy/docker-compose.yml pull + sudo docker-compose -f ~/deploy/docker-compose.yml up -d sudo docker image prune -f From 3b4ee9cd4b3a558cfbd22d6af3ec8c378431b48d Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Tue, 25 Jun 2024 01:04:05 +0900 Subject: [PATCH 32/39] =?UTF-8?q?chore:env=20=ED=99=98=EA=B2=BD=EB=B3=80?= =?UTF-8?q?=EC=88=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev_deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index 31f8ffc..0aef208 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -100,6 +100,7 @@ jobs: script: | sudo apt-get update sudo apt-get install -y docker-compose + echo "DB_URL=${{ secrets.DB_URL }}" > ~/deploy/.env echo "DB_USERNAME=${{ secrets.DB_USERNAME }}" > ~/deploy/.env echo "DB_PASSWORD=${{ secrets.DB_PASSWORD }}" >> ~/deploy/.env echo "AWS_ACCESSKEY=${{ secrets.AWS_ACCESSKEY }}" >> ~/deploy/.env From 84997cd8a97f993bfd46cec5b52bf2295c19e757 Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Tue, 25 Jun 2024 01:12:16 +0900 Subject: [PATCH 33/39] =?UTF-8?q?chore:docker-compose=20=EB=B2=84=EC=A0=84?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index a58edc4..1c946c6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: '3.8' +version: '3' services: app: From 02cfc86ff08f1dab67e827a467bcb9fbefc5523b Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Tue, 25 Jun 2024 01:34:12 +0900 Subject: [PATCH 34/39] =?UTF-8?q?chore:docker-compose=20=EB=B2=84=EC=A0=84?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev_deploy.yml | 4 ++-- docker-compose.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index 0aef208..937ab9c 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -100,8 +100,8 @@ jobs: script: | sudo apt-get update sudo apt-get install -y docker-compose - echo "DB_URL=${{ secrets.DB_URL }}" > ~/deploy/.env - echo "DB_USERNAME=${{ secrets.DB_USERNAME }}" > ~/deploy/.env + echo "DB_URL=${{ secrets.DB_URL }}" >> ~/deploy/.env + echo "DB_USERNAME=${{ secrets.DB_USERNAME }}" >> ~/deploy/.env echo "DB_PASSWORD=${{ secrets.DB_PASSWORD }}" >> ~/deploy/.env echo "AWS_ACCESSKEY=${{ secrets.AWS_ACCESSKEY }}" >> ~/deploy/.env echo "AWS_SECRETKEY=${{ secrets.AWS_SECRETKEY }}" >> ~/deploy/.env diff --git a/docker-compose.yml b/docker-compose.yml index 1c946c6..a58edc4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: '3' +version: '3.8' services: app: From 53480f3f0b090dcb9ef05cf08d6e5a17ac160d36 Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Tue, 25 Jun 2024 01:41:18 +0900 Subject: [PATCH 35/39] =?UTF-8?q?chore:ci-cd=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev_deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index 937ab9c..0cb1e12 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -46,6 +46,7 @@ jobs: - name: Build With Gradle run: ./gradlew build -x test + # 디렉토리 생성 - name: Create deploy directory uses: appleboy/ssh-action@master with: From fe646cd27c17db40752973b681b24e6e047262a1 Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Tue, 25 Jun 2024 01:50:57 +0900 Subject: [PATCH 36/39] =?UTF-8?q?chore:ci-cd=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev_deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index 0cb1e12..5e1a2c5 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -99,8 +99,8 @@ jobs: username: ubuntu key: ${{ secrets.EC2_SSH_KEY }} # EC2 서버에 접근하기 위한 SSH 개인 키 script: | - sudo apt-get update - sudo apt-get install -y docker-compose +# sudo apt-get update +# sudo apt-get install -y docker-compose echo "DB_URL=${{ secrets.DB_URL }}" >> ~/deploy/.env echo "DB_USERNAME=${{ secrets.DB_USERNAME }}" >> ~/deploy/.env echo "DB_PASSWORD=${{ secrets.DB_PASSWORD }}" >> ~/deploy/.env From e6b56209234c71229f4d10caa1f82ecd084c2234 Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Tue, 25 Jun 2024 01:56:38 +0900 Subject: [PATCH 37/39] =?UTF-8?q?chore:ci-cd=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev_deploy.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index 5e1a2c5..a72cf62 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -99,8 +99,6 @@ jobs: username: ubuntu key: ${{ secrets.EC2_SSH_KEY }} # EC2 서버에 접근하기 위한 SSH 개인 키 script: | -# sudo apt-get update -# sudo apt-get install -y docker-compose echo "DB_URL=${{ secrets.DB_URL }}" >> ~/deploy/.env echo "DB_USERNAME=${{ secrets.DB_USERNAME }}" >> ~/deploy/.env echo "DB_PASSWORD=${{ secrets.DB_PASSWORD }}" >> ~/deploy/.env From e7126d92ceff0839517990338ca499a384b41d36 Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Tue, 25 Jun 2024 14:49:13 +0900 Subject: [PATCH 38/39] =?UTF-8?q?chore:=20ci-cd=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .deploy/deploy.sh | 21 ------------------- .../controller/api/AnniversaryApi.java | 2 +- src/main/resources/application.yml | 2 +- 3 files changed, 2 insertions(+), 23 deletions(-) delete mode 100644 .deploy/deploy.sh diff --git a/.deploy/deploy.sh b/.deploy/deploy.sh deleted file mode 100644 index b072f5e..0000000 --- a/.deploy/deploy.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -# 현재 실행 중인 JAR 프로세스를 찾고 종료합니다. -CURRENT_PID=$(pgrep -f .jar) -echo "$CURRENT_PID" -if [ -z $CURRENT_PID ]; then - echo "no process" -else - echo "kill $CURRENT_PID" - kill -9 $CURRENT_PID - sleep 3 -fi - -# 새로운 JAR 파일의 경로를 설정하고 실행 권한을 부여합니다. -JAR_PATH="/home/ec2-user/cicd/*.jar" -echo "jar path : $JAR_PATH" -chmod +x $JAR_PATH - -# 새로운 JAR 파일을 백그라운드에서 실행합니다. -nohup java -jar $JAR_PATH > /dev/null 2> /dev/null < /dev/null & -echo "jar file deploy success" diff --git a/src/main/java/com/example/fiurinee/domain/anniversary/controller/api/AnniversaryApi.java b/src/main/java/com/example/fiurinee/domain/anniversary/controller/api/AnniversaryApi.java index 49a9b2d..0e47cd8 100644 --- a/src/main/java/com/example/fiurinee/domain/anniversary/controller/api/AnniversaryApi.java +++ b/src/main/java/com/example/fiurinee/domain/anniversary/controller/api/AnniversaryApi.java @@ -37,7 +37,7 @@ public interface AnniversaryApi { ResponseEntity addAnniversary(@Parameter(name = "id", description = "멤버아이디")@PathVariable Long id, @RequestBody AnniversaryRequestDTO request); @Operation( - summary = "기념일 수정", + summary = "기념일 수정입니닷", description = "사용자의 기념일을 수정합니다.", security = @SecurityRequirement(name = "bearerAuth") ) diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 5b59825..2c7c67c 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -33,7 +33,7 @@ spring: client-id: ${KAKAO_CLIENT_ID} client-secret: ${KAKAO_CLIENT_SECRET} client-authentication-method: client_secret_post - redirect-uri: http://localhost:8080/oauth2/authorization/kakao + redirect-uri: http://localhost:8080/login/oauth2/code/kakao authorization-grant-type: authorization_code client-name: kakao scope: From 374aaa8f19fce10c7e4b8510a41f67337f816399 Mon Sep 17 00:00:00 2001 From: jihyeon baek Date: Tue, 25 Jun 2024 14:54:35 +0900 Subject: [PATCH 39/39] =?UTF-8?q?chore:redis=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 2c7c67c..e5e31ad 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -33,7 +33,7 @@ spring: client-id: ${KAKAO_CLIENT_ID} client-secret: ${KAKAO_CLIENT_SECRET} client-authentication-method: client_secret_post - redirect-uri: http://localhost:8080/login/oauth2/code/kakao + redirect-uri: http://3.36.169.209:8080/login/oauth2/code/kakao authorization-grant-type: authorization_code client-name: kakao scope: