From d77fe7e9ce12da34e4596bcd305716c30dc50ef3 Mon Sep 17 00:00:00 2001 From: dooboocookie <79090478+dooboocookie@users.noreply.github.com> Date: Thu, 5 Oct 2023 14:28:21 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=EC=9B=8C=ED=81=AC=ED=94=8C=EB=A1=9C?= =?UTF-8?q?=EC=9A=B0=20=EC=88=98=EC=A0=95=20chore:=20=EB=A1=9C=EA=B7=B8=20?= =?UTF-8?q?=EA=B2=BD=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflows/backend_prod_merge_workflow.yml | 23 ++++++- .../workflows/backend_rel_merge_workflow.yml | 60 +++++++++++++++++++ .../com/now/naaga/like/domain/PlaceLike.java | 1 + backend/src/main/resources/error-appender.xml | 2 +- backend/src/main/resources/info-appender.xml | 2 +- backend/src/main/resources/warn-appender.xml | 2 +- 6 files changed, 86 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/backend_rel_merge_workflow.yml diff --git a/.github/workflows/backend_prod_merge_workflow.yml b/.github/workflows/backend_prod_merge_workflow.yml index 69cb6861a..9615d5c08 100644 --- a/.github/workflows/backend_prod_merge_workflow.yml +++ b/.github/workflows/backend_prod_merge_workflow.yml @@ -4,7 +4,9 @@ on: push: branches: - main - + paths: + - backend/** + jobs: deploy: runs-on: naaga @@ -38,3 +40,22 @@ jobs: cd /home/ubuntu/prod chmod +x ./deploy_prod.sh sudo ./deploy_prod.sh + + sync-dev_backend: + needs: deploy + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + ref: main + + - name: merge main -> dev_backend + uses: devmasx/merge-branch@master + with: + type: now + from_branch: main + target_branch: dev_backend + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/backend_rel_merge_workflow.yml b/.github/workflows/backend_rel_merge_workflow.yml new file mode 100644 index 000000000..3ac3a3e3b --- /dev/null +++ b/.github/workflows/backend_rel_merge_workflow.yml @@ -0,0 +1,60 @@ +name: NAAGA BACKEND RELEASE SERVER MERGE CI/CD + +on: + push: + branches: + - release/** + paths: + - backend/** + +jobs: + deploy: + runs-on: naaga + steps: + - name: change permission + run: | + sudo chown -R ubuntu:ubuntu /home/ubuntu/actions-runner/naaga/2023-naaga/2023-naaga + + - name: checkout + uses: actions/checkout@v3 + with: + submodules: true + ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} + + - name: project remove + run: | + sudo rm -rf /home/ubuntu/prod/2023-naaga + + - name: project copy + run: | + sudo cp -r /home/ubuntu/actions-runner/naaga/2023-naaga/2023-naaga /home/ubuntu/prod + + - name: build + run: | + cd /home/ubuntu/prod/2023-naaga/backend + sudo chmod +x ./gradlew + sudo ./gradlew clean bootJar + + - name: transfer & run + run: | + cd /home/ubuntu/prod + chmod +x ./deploy_prod.sh + sudo ./deploy_prod.sh + + sync-dev_backend: + needs: deploy + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + ref: main + + - name: merge release -> dev_backend + uses: devmasx/merge-branch@master + with: + type: now + target_branch: dev_backend + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/backend/src/main/java/com/now/naaga/like/domain/PlaceLike.java b/backend/src/main/java/com/now/naaga/like/domain/PlaceLike.java index 5bebc705b..744ed121b 100644 --- a/backend/src/main/java/com/now/naaga/like/domain/PlaceLike.java +++ b/backend/src/main/java/com/now/naaga/like/domain/PlaceLike.java @@ -13,6 +13,7 @@ import jakarta.persistence.ManyToOne; import java.util.Objects; +// 아직 미구역 영역입니다. 사실 백엔드 디렉토리 변경을 위한 변경사항입니다. @Entity public class PlaceLike extends BaseEntity { diff --git a/backend/src/main/resources/error-appender.xml b/backend/src/main/resources/error-appender.xml index e286d8e09..f4653fc7c 100644 --- a/backend/src/main/resources/error-appender.xml +++ b/backend/src/main/resources/error-appender.xml @@ -1,6 +1,6 @@ - ./logs/error.log + /home/ubuntu/logs/error.log ERROR ACCEPT diff --git a/backend/src/main/resources/info-appender.xml b/backend/src/main/resources/info-appender.xml index 5490cc1f7..61fd1690f 100644 --- a/backend/src/main/resources/info-appender.xml +++ b/backend/src/main/resources/info-appender.xml @@ -1,6 +1,6 @@ - ./logs/info.log + /home/ubuntu/logs/info.log INFO ACCEPT diff --git a/backend/src/main/resources/warn-appender.xml b/backend/src/main/resources/warn-appender.xml index 16d602b4a..07c1e4e89 100644 --- a/backend/src/main/resources/warn-appender.xml +++ b/backend/src/main/resources/warn-appender.xml @@ -1,6 +1,6 @@ - ./logs/warn.log + /home/ubuntu/logs/warn.log WARN ACCEPT