Skip to content

Commit

Permalink
chore: 배포 전용 프로파일 생성
Browse files Browse the repository at this point in the history
- 배포 시 사용할 애플리케이션 프로파일 생성.
  • Loading branch information
shacomiro committed Jan 24, 2024
1 parent 94525a2 commit 5be5538
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 22 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
### secret config ###
config/*-config.yaml
**/external-config.yaml
**/ext-config.yaml
**/external-*-config.yaml
Expand Down
28 changes: 23 additions & 5 deletions app-api/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ spring:
- application-domain.yaml
profiles:
group:
prod:
- app-api-prod
- domains-prod
dev:
- app-api-dev
- domains-dev
Expand All @@ -17,6 +20,22 @@ spring:
resources:
add-mappings: false
---
spring:
config:
activate:
on-profile: app-api-prod
servlet:
multipart:
max-file-size: 50MB
max-request-size: 50MB
jwt:
secret:
key: ${prod-config.jwt.secret.key}
issuer: ${prod-config.jwt.issuer}
valid-milliseconds:
access: ${prod-config.jwt.valid-milliseconds.access}
refresh: ${prod-config.jwt.valid-milliseconds.refresh}
---
spring:
config:
activate:
Expand All @@ -27,11 +46,11 @@ spring:
max-request-size: 50MB
jwt:
secret:
key: ${ext-config.jwt.secret.key}
issuer: ${ext-config.jwt.issuer}
key: ${dev-config.jwt.secret.key}
issuer: ${dev-config.jwt.issuer}
valid-milliseconds:
access: ${ext-config.jwt.valid-milliseconds.access}
refresh: ${ext-config.jwt.valid-milliseconds.refresh}
access: ${dev-config.jwt.valid-milliseconds.access}
refresh: ${dev-config.jwt.valid-milliseconds.refresh}
---
spring:
config:
Expand All @@ -48,4 +67,3 @@ jwt:
valid-milliseconds:
access: 30000
refresh: 60000

29 changes: 24 additions & 5 deletions app-batch/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ spring:
- application-domain-rds.yaml
profiles:
group:
prod:
- batch-app-prod
- domains-rds-prod
dev:
- batch-app-dev
- domain-rds-dev
Expand All @@ -19,6 +22,22 @@ spring:
main:
web-application-type: none
---
spring:
config:
activate:
on-profile: batch-app-prod
batch:
jdbc:
initialize-schema: always
aws:
s3:
service-endpoint: ${prod-config.aws.s3.service-endpoint}
key:
access: ${prod-config.aws.s3.access-key}
secret: ${prod-config.aws.s3.secret-key}
region: ${prod-config.aws.s3.region}
bucket: ${prod-config.aws.s3.bucket}
---
spring:
config:
activate:
Expand All @@ -28,12 +47,12 @@ spring:
initialize-schema: always
aws:
s3:
service-endpoint: ${ext-config.aws.s3.service-endpoint}
service-endpoint: ${dev-config.aws.s3.service-endpoint}
key:
access: ${ext-config.aws.s3.access-key}
secret: ${ext-config.aws.s3.secret-key}
region: ${ext-config.aws.s3.region}
bucket: ${ext-config.aws.s3.bucket}
access: ${dev-config.aws.s3.access-key}
secret: ${dev-config.aws.s3.secret-key}
region: ${dev-config.aws.s3.region}
bucket: ${dev-config.aws.s3.bucket}
---
spring:
config:
Expand Down
16 changes: 13 additions & 3 deletions domain-rds/src/main/resources/application-domain-rds.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
spring:
config:
activate:
on-profile: domain-rds-prod
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://${prod-config.rds.secret.url}?serverTimezone=${prod-config.rds.config.time-zone}&characterEncoding=${prod-config.rds.config.encoding}
username: ${prod-config.rds.secret.username}
password: ${prod-config.rds.secret.password}
---
spring:
config:
activate:
on-profile: domain-rds-dev
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://${ext-config.rds.secret.url}?serverTimezone=${ext-config.rds.config.time-zone}&characterEncoding=${ext-config.rds.config.encoding}
username: ${ext-config.rds.secret.username}
password: ${ext-config.rds.secret.password}
url: jdbc:mysql://${dev-config.rds.secret.url}?serverTimezone=${dev-config.rds.config.time-zone}&characterEncoding=${dev-config.rds.config.encoding}
username: ${dev-config.rds.secret.username}
password: ${dev-config.rds.secret.password}
---
spring:
config:
Expand Down
12 changes: 10 additions & 2 deletions domain-redis/src/main/resources/application-domain-redis.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
spring:
config:
activate:
on-profile: domain-redis-prod
redis:
port: ${prod-config.redis.secret.port}
host: ${prod-config.redis.secret.host}
---
spring:
config:
activate:
on-profile: domain-redis-dev
redis:
port: ${ext-config.redis.secret.port}
host: ${ext-config.redis.secret.host}
port: ${dev-config.redis.secret.port}
host: ${dev-config.redis.secret.host}
---
spring:
config:
Expand Down
35 changes: 28 additions & 7 deletions domain/src/main/resources/application-domain.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ spring:
- application-domain-redis.yaml
profiles:
group:
domains-prod:
- domain-prod
- domain-rds-prod
- domain-redis-prod
domains-dev:
- domain-dev
- domain-rds-dev
Expand All @@ -16,22 +20,39 @@ spring:
- domain-redis-local
- domain-rds-debug
---
spring:
config:
activate:
on-profile: domain-prod
aws:
s3:
service-endpoint: ${prod-config.aws.s3.service-endpoint}
key:
access: ${prod-config.aws.s3.access-key}
secret: ${prod-config.aws.s3.secret-key}
region: ${prod-config.aws.s3.region}
bucket: ${prod-config.aws.s3.bucket}
java-epub-generator:
directory:
content: ${prod-config.ebook.content-directory}
ebook: ${prod-config.ebook.ebook-directory}
---
spring:
config:
activate:
on-profile: domain-dev
aws:
s3:
service-endpoint: ${ext-config.aws.s3.service-endpoint}
service-endpoint: ${dev-config.aws.s3.service-endpoint}
key:
access: ${ext-config.aws.s3.access-key}
secret: ${ext-config.aws.s3.secret-key}
region: ${ext-config.aws.s3.region}
bucket: ${ext-config.aws.s3.bucket}
access: ${dev-config.aws.s3.access-key}
secret: ${dev-config.aws.s3.secret-key}
region: ${dev-config.aws.s3.region}
bucket: ${dev-config.aws.s3.bucket}
java-epub-generator:
directory:
content: ${ext-config.ebook.content-directory}
ebook: ${ext-config.ebook.ebook-directory}
content: ${dev-config.ebook.content-directory}
ebook: ${dev-config.ebook.ebook-directory}
---
spring:
config:
Expand Down

0 comments on commit 5be5538

Please sign in to comment.