From 6ac0de277c65005d563541a0fa29d62a6aec71b2 Mon Sep 17 00:00:00 2001 From: seokjin8678 Date: Mon, 1 Apr 2024 17:30:09 +0900 Subject: [PATCH 1/7] =?UTF-8?q?refactor:=20=EC=84=9C=EB=B8=8C=EB=AA=A8?= =?UTF-8?q?=EB=93=88=20=EC=9C=84=EC=B9=98=20=EB=B3=80=EA=B2=BD=20=EB=B0=8F?= =?UTF-8?q?=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitmodules | 4 ++-- backend/src/main/resources/application.yml | 5 ----- backend/src/main/resources/config | 1 + backend/src/main/resources/festago-config | 1 - 4 files changed, 3 insertions(+), 8 deletions(-) create mode 160000 backend/src/main/resources/config delete mode 160000 backend/src/main/resources/festago-config diff --git a/.gitmodules b/.gitmodules index 550533915..76d6e720b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "backend/src/main/resources/festago-config"] - path = backend/src/main/resources/festago-config +[submodule "backend/src/main/resources/config"] + path = backend/src/main/resources/config url = https://github.com/festago/festago-config.git diff --git a/backend/src/main/resources/application.yml b/backend/src/main/resources/application.yml index 38c23dc60..d74c444c1 100644 --- a/backend/src/main/resources/application.yml +++ b/backend/src/main/resources/application.yml @@ -1,8 +1,3 @@ spring: profiles: active: local - config: - import: - - classpath:/festago-config/backend/application-dev.yml - - classpath:/festago-config/backend/application-prod.yml - - classpath:/festago-config/backend/application-infra.yml diff --git a/backend/src/main/resources/config b/backend/src/main/resources/config new file mode 160000 index 000000000..dbe6a38b3 --- /dev/null +++ b/backend/src/main/resources/config @@ -0,0 +1 @@ +Subproject commit dbe6a38b35b6ab59587844fbed7d87f8314a58ed diff --git a/backend/src/main/resources/festago-config b/backend/src/main/resources/festago-config deleted file mode 160000 index 691d66a3c..000000000 --- a/backend/src/main/resources/festago-config +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 691d66a3ca69cd811862c06138c949043b546f59 From 7a3af928ab75d2ed6baa71c7bc8d5a84ed644547 Mon Sep 17 00:00:00 2001 From: seokjin8678 Date: Mon, 1 Apr 2024 19:04:06 +0900 Subject: [PATCH 2/7] =?UTF-8?q?feat:=20=EC=83=88=EB=A1=9C=EC=9A=B4=20?= =?UTF-8?q?=EA=B0=9C=EB=B0=9C=20=ED=99=98=EA=B2=BD=EC=97=90=20=EB=A7=9E?= =?UTF-8?q?=EC=B6=98=20CD=20Github=20Action=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd-back-dev.yml | 33 +++++++++++++++++++------------ backend/Dockerfile | 4 ++++ 2 files changed, 24 insertions(+), 13 deletions(-) create mode 100644 backend/Dockerfile diff --git a/.github/workflows/cd-back-dev.yml b/.github/workflows/cd-back-dev.yml index ee3c7402c..a1797fd52 100644 --- a/.github/workflows/cd-back-dev.yml +++ b/.github/workflows/cd-back-dev.yml @@ -4,7 +4,8 @@ on: push: branches: - dev - paths: 'backend/**' + paths: + - 'backend/**' workflow_dispatch: concurrency: @@ -37,22 +38,28 @@ jobs: - name: bootJar with gradle run: ./gradlew bootJar - # 2023-11-23 기준 EC2 프리티어 사용으로 인해 DEV 환경을 PROD 환경에서 실행함 - - name: deploy use scp - uses: appleboy/scp-action@master + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker Login + uses: docker/login-action@v3.1.0 + with: + username: ${{ vars.DOCKER_HUB_DEV_USERNAME }} + password: ${{ secrets.DOCKER_HUB_DEV_LOGIN_TOKEN }} + + - name: Build and push Docker images + uses: docker/build-push-action@v5.3.0 with: - host: ${{secrets.FESTAGO_PROD_IP}} - username: ${{secrets.FESTAGO_PROD_USERNAME}} - key: ${{secrets.FESTAGO_SSH_KEY}} - source: "./backend/build/libs/*.jar" - target: ${{ vars.FESTAGO_PROD_JAR_DIR }} - strip_components: 3 + context: . + push: true + tags: ${{ vars.DOCKER_DEV_TAG }} + platforms: linux/amd64 - name: run application use ssh uses: appleboy/ssh-action@master with: - host: ${{secrets.FESTAGO_PROD_IP}} - username: ${{secrets.FESTAGO_PROD_USERNAME}} - key: ${{secrets.FESTAGO_SSH_KEY}} + host: ${{ vars.FESTAGO_DEV_IP }} + username: ${{ vars.FESTAGO_DEV_USERNAME }} + key: ${{secrets.FESTAGO_DEV_SSH_KEY}} script_stop: true script: ${{ vars.FESTAGO_DEV_DEPLOY_COMMAND }} diff --git a/backend/Dockerfile b/backend/Dockerfile new file mode 100644 index 000000000..99f3e9e94 --- /dev/null +++ b/backend/Dockerfile @@ -0,0 +1,4 @@ +FROM openjdk:17-jdk +ARG JAR_FILE_PATH=./build/libs/*.jar +COPY ${JAR_FILE_PATH} app.jar +ENTRYPOINT ["java", "-jar", "-Duser.timezone=Asia/Seoul", "app.jar"] From 88c4636c71230b53d2b43c02932c00280dfe50b5 Mon Sep 17 00:00:00 2001 From: seokjin8678 Date: Mon, 1 Apr 2024 19:17:01 +0900 Subject: [PATCH 3/7] =?UTF-8?q?fix:=20Dockerfile=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/cd-back-dev.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cd-back-dev.yml b/.github/workflows/cd-back-dev.yml index a1797fd52..faba446b3 100644 --- a/.github/workflows/cd-back-dev.yml +++ b/.github/workflows/cd-back-dev.yml @@ -52,6 +52,7 @@ jobs: with: context: . push: true + file: ./backend/Dockerfile tags: ${{ vars.DOCKER_DEV_TAG }} platforms: linux/amd64 From d827e086959c88456e0fbe4fb197f1b70db74c95 Mon Sep 17 00:00:00 2001 From: seokjin8678 Date: Mon, 1 Apr 2024 19:22:31 +0900 Subject: [PATCH 4/7] =?UTF-8?q?fix:=20Dockerfile=20=EB=82=B4=EB=B6=80=20ja?= =?UTF-8?q?r=20=ED=8C=8C=EC=9D=BC=20=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 --- backend/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 99f3e9e94..c27a356ad 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,4 +1,4 @@ FROM openjdk:17-jdk -ARG JAR_FILE_PATH=./build/libs/*.jar +ARG JAR_FILE_PATH=build/libs/*.jar COPY ${JAR_FILE_PATH} app.jar ENTRYPOINT ["java", "-jar", "-Duser.timezone=Asia/Seoul", "app.jar"] From 26baf0806d30e9fb46fddfd972c1264e5a0bdcce Mon Sep 17 00:00:00 2001 From: seokjin8678 Date: Mon, 1 Apr 2024 19:30:20 +0900 Subject: [PATCH 5/7] =?UTF-8?q?fix:=20Docker=20push=20=EC=A7=81=EC=A0=91?= =?UTF-8?q?=20=EC=8A=A4=ED=81=AC=EB=A6=BD=ED=8A=B8=20=EC=82=AC=EC=9A=A9?= =?UTF-8?q?=ED=95=98=EB=8F=84=EB=A1=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd-back-dev.yml | 16 +++++----------- backend/Dockerfile | 2 +- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cd-back-dev.yml b/.github/workflows/cd-back-dev.yml index faba446b3..ef512f945 100644 --- a/.github/workflows/cd-back-dev.yml +++ b/.github/workflows/cd-back-dev.yml @@ -38,23 +38,17 @@ jobs: - name: bootJar with gradle run: ./gradlew bootJar - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Docker Login uses: docker/login-action@v3.1.0 with: username: ${{ vars.DOCKER_HUB_DEV_USERNAME }} password: ${{ secrets.DOCKER_HUB_DEV_LOGIN_TOKEN }} - - name: Build and push Docker images - uses: docker/build-push-action@v5.3.0 - with: - context: . - push: true - file: ./backend/Dockerfile - tags: ${{ vars.DOCKER_DEV_TAG }} - platforms: linux/amd64 + - name: Build Docker images + run: docker build -t ${{ vars.DOCKER_DEV_TAG }} . + + - name: Push Docker images + run: docker push -t ${{ vars.DOCKER_DEV_TAG }} . - name: run application use ssh uses: appleboy/ssh-action@master diff --git a/backend/Dockerfile b/backend/Dockerfile index c27a356ad..99f3e9e94 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,4 +1,4 @@ FROM openjdk:17-jdk -ARG JAR_FILE_PATH=build/libs/*.jar +ARG JAR_FILE_PATH=./build/libs/*.jar COPY ${JAR_FILE_PATH} app.jar ENTRYPOINT ["java", "-jar", "-Duser.timezone=Asia/Seoul", "app.jar"] From f4598520e02c7ca73d2595189ad51e1a9b7c6958 Mon Sep 17 00:00:00 2001 From: seokjin8678 Date: Mon, 1 Apr 2024 19:32:33 +0900 Subject: [PATCH 6/7] =?UTF-8?q?fix:=20Docker=20push=20=EC=8A=A4=ED=81=AC?= =?UTF-8?q?=EB=A6=BD=ED=8A=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd-back-dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd-back-dev.yml b/.github/workflows/cd-back-dev.yml index ef512f945..a91a8327f 100644 --- a/.github/workflows/cd-back-dev.yml +++ b/.github/workflows/cd-back-dev.yml @@ -48,7 +48,7 @@ jobs: run: docker build -t ${{ vars.DOCKER_DEV_TAG }} . - name: Push Docker images - run: docker push -t ${{ vars.DOCKER_DEV_TAG }} . + run: docker push ${{ vars.DOCKER_DEV_TAG }} - name: run application use ssh uses: appleboy/ssh-action@master From fbb8ea30acdbe5c7d5101c4ad72eb2a6b2f796df Mon Sep 17 00:00:00 2001 From: seokjin8678 Date: Mon, 1 Apr 2024 20:02:40 +0900 Subject: [PATCH 7/7] =?UTF-8?q?feat:=20=EC=84=9C=EB=B8=8C=20=EB=AA=A8?= =?UTF-8?q?=EB=93=88=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/main/resources/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/main/resources/config b/backend/src/main/resources/config index dbe6a38b3..2ecee3ca4 160000 --- a/backend/src/main/resources/config +++ b/backend/src/main/resources/config @@ -1 +1 @@ -Subproject commit dbe6a38b35b6ab59587844fbed7d87f8314a58ed +Subproject commit 2ecee3ca4113d2a72111584a9f01c379906e01a4