Skip to content

Commit

Permalink
[BE] refactor: 서브모듈 위치 변경 및 경로 변경 (#826) (#827)
Browse files Browse the repository at this point in the history
* refactor: 서브모듈 위치 변경 및 업데이트

* feat: 새로운 개발 환경에 맞춘 CD Github Action 수정

* fix: Dockerfile 경로 수정

* fix: Dockerfile 내부 jar 파일 경로 수정

* fix: Docker push 직접 스크립트 사용하도록 변경

* fix: Docker push 스크립트 수정

* feat: 서브 모듈 업데이트
  • Loading branch information
seokjin8678 authored Apr 2, 2024
1 parent ca21e27 commit 07dc38c
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 21 deletions.
28 changes: 15 additions & 13 deletions .github/workflows/cd-back-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ on:
push:
branches:
- dev
paths: 'backend/**'
paths:
- 'backend/**'
workflow_dispatch:

concurrency:
Expand Down Expand Up @@ -37,22 +38,23 @@ jobs:
- name: bootJar with gradle
run: ./gradlew bootJar

# 2023-11-23 기준 EC2 프리티어 사용으로 인해 DEV 환경을 PROD 환경에서 실행함
- name: deploy use scp
uses: appleboy/scp-action@master
- name: Docker Login
uses: docker/[email protected]
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
username: ${{ vars.DOCKER_HUB_DEV_USERNAME }}
password: ${{ secrets.DOCKER_HUB_DEV_LOGIN_TOKEN }}

- name: Build Docker images
run: docker build -t ${{ vars.DOCKER_DEV_TAG }} .

- name: Push Docker images
run: docker push ${{ vars.DOCKER_DEV_TAG }}

- 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 }}
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
5 changes: 0 additions & 5 deletions backend/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions backend/src/main/resources/config
Submodule config added at 2ecee3
1 change: 0 additions & 1 deletion backend/src/main/resources/festago-config
Submodule festago-config deleted from 691d66

0 comments on commit 07dc38c

Please sign in to comment.