Skip to content

Commit

Permalink
feat: 개발환경과 배포환경 분리를 위한 profile 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
wldns2577 committed Oct 5, 2023
1 parent 6686cd5 commit e97555e
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
shell: bash # (6) 권한 부여

- name: Build with Gradle
run: ./gradlew clean build
run: ./gradlew clean bootjar -Pprofile=prod
shell: bash # (8) build 시작

- name: Get current time
Expand Down
41 changes: 37 additions & 4 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,52 @@
spring:
profiles:
default: dev
group:
"dev" : "localdb, common"
"prod" : "proddb, common"

---

spring:
config:
activate:
on-profile: "localdb"
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/carGive?serverTimezone=UTC&characterEncoding=UTF-8
username:
username: root
password:

---

spring:
config:
activate:
on-profile: "proddb"
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://${RDS_HOST}:3306/carGive?serverTimezone=UTC&characterEncoding=UTF-8
username: ${RDS_USERNAME}
password: ${RDS_PASSWORD}

---

spring:
config:
activate:
on-profile: "common"
jpa:
open-in-view: false
hibernate:
ddl-auto: none
ddl-auto: update
properties:
hibernate:
show_sql: false
format_sql: true
default_batch_fetch_size: 50
default_batch_fetch_size: 50

logging:
level:
com:
amazonaws:
util:
EC2MetadataUtils: error

0 comments on commit e97555e

Please sign in to comment.