Skip to content

Commit

Permalink
[BE] 프로파일 분리, CD 스크립트 수정 (#235)
Browse files Browse the repository at this point in the history
* feat: 프로파일 분리

* feat: 프로파일 분리

* cd: 프로파일 분리 cd 스크립트 수정
  • Loading branch information
donghoony authored Aug 7, 2024
1 parent 38b6dc7 commit 990b933
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 32 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/backend-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,16 @@ jobs:
runs-on: self-hosted

steps:
- name: Checkout to secret repository
uses: actions/checktout@v4
with:
repository: ${{ secret.PRIVATE_REPOSITORY_URL }}
token: ${{ secret.PRIVATE_REPOSITORY_TOKEN }}

- name: Download uploaded artifact
uses: actions/download-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.ARTIFACT_DIRECTORY }}

- name: Find ${{ env.ARTIFACT_NAME }} process
run: |
Expand All @@ -85,4 +90,4 @@ jobs:
- name: Start server
run: |
sudo nohup java -jar ${{ env.ARTIFACT_DIRECTORY }}/${{ env.ARTIFACT_NAME }}.jar --server.port=80 --spring.profiles.active=local &
sudo nohup java -jar ${{ env.ARTIFACT_NAME }}.jar --server.port=80 --spring.config.location=application-dev.yml &
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ docs:
title: "리뷰미 API"
description: "이 문서는 리뷰미 API 구현 방법을 소개합니다."
version: "0.0.1"

springdoc:
swagger-ui:
path: /api-docs
operations-sorter: alpha
tags-sorter: alpha
35 changes: 8 additions & 27 deletions backend/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
spring:
profiles:
active: local

config:
import:
- classpath:api-docs.yml
- classpath:logback.yml

datasource:
url: jdbc:h2:mem:test
username: sa
Expand All @@ -11,30 +19,3 @@ spring:
show-sql: true
hibernate:
ddl-auto: update
config:
import:
- classpath:/secret/application-actuator.yml
- classpath:/application-api-docs.yml
profiles:
active: local

springdoc:
swagger-ui:
path: /api-docs
operations-sorter: alpha
tags-sorter: alpha

logging:
config: classpath:logback-spring.xml
file:
path: logs
name: review-me.log
level:
springframework: DEBUG
logback:
rolling-policy:
max-history: 100
file-name-pattern: review-me.%d{yyyy-MM-dd}.log
pattern:
console: "%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(${PID:- }){magenta} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wEx"
file: "%d{yyyy-MM-dd HH:mm:ss.SSS} %5p ${PID:- } [%15.15t] %-40.40logger{39} : %m%n%wEx"
14 changes: 14 additions & 0 deletions backend/src/main/resources/logback.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
logging:
config: classpath:logback-spring.xml
file:
path: logs
name: review-me.log
level:
springframework: DEBUG
logback:
rolling-policy:
max-history: 100
file-name-pattern: review-me.%d{yyyy-MM-dd}.log
pattern:
console: "%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(${PID:- }){magenta} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wEx"
file: "%d{yyyy-MM-dd HH:mm:ss.SSS} %5p ${PID:- } [%15.15t] %-40.40logger{39} : %m%n%wEx"
2 changes: 1 addition & 1 deletion backend/src/main/resources/secret
2 changes: 0 additions & 2 deletions backend/src/test/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ spring:
show-sql: true
hibernate:
ddl-auto: update
profiles:
include: api-docs

springdoc:
swagger-ui:
Expand Down

0 comments on commit 990b933

Please sign in to comment.