From 5be55380330280f0ce8e59ffccfd2cfcd82672a6 Mon Sep 17 00:00:00 2001 From: Sunghyun Lee <98dltjdgus@naver.com> Date: Wed, 24 Jan 2024 09:23:38 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=EB=B0=B0=ED=8F=AC=20=EC=A0=84?= =?UTF-8?q?=EC=9A=A9=20=ED=94=84=EB=A1=9C=ED=8C=8C=EC=9D=BC=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 배포 시 사용할 애플리케이션 프로파일 생성. --- .gitignore | 1 + app-api/src/main/resources/application.yaml | 28 ++++++++++++--- app-batch/src/main/resources/application.yaml | 29 ++++++++++++--- .../resources/application-domain-rds.yaml | 16 +++++++-- .../resources/application-domain-redis.yaml | 12 +++++-- .../main/resources/application-domain.yaml | 35 +++++++++++++++---- 6 files changed, 99 insertions(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index c5ce871..2cf9682 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ ### secret config ### +config/*-config.yaml **/external-config.yaml **/ext-config.yaml **/external-*-config.yaml diff --git a/app-api/src/main/resources/application.yaml b/app-api/src/main/resources/application.yaml index a2245d5..21f3d63 100644 --- a/app-api/src/main/resources/application.yaml +++ b/app-api/src/main/resources/application.yaml @@ -4,6 +4,9 @@ spring: - application-domain.yaml profiles: group: + prod: + - app-api-prod + - domains-prod dev: - app-api-dev - domains-dev @@ -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: @@ -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: @@ -48,4 +67,3 @@ jwt: valid-milliseconds: access: 30000 refresh: 60000 - diff --git a/app-batch/src/main/resources/application.yaml b/app-batch/src/main/resources/application.yaml index fe8637f..837521a 100644 --- a/app-batch/src/main/resources/application.yaml +++ b/app-batch/src/main/resources/application.yaml @@ -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 @@ -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: @@ -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: diff --git a/domain-rds/src/main/resources/application-domain-rds.yaml b/domain-rds/src/main/resources/application-domain-rds.yaml index 441ba9d..ac7adbd 100644 --- a/domain-rds/src/main/resources/application-domain-rds.yaml +++ b/domain-rds/src/main/resources/application-domain-rds.yaml @@ -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: diff --git a/domain-redis/src/main/resources/application-domain-redis.yaml b/domain-redis/src/main/resources/application-domain-redis.yaml index c4d430c..dc8b0ac 100644 --- a/domain-redis/src/main/resources/application-domain-redis.yaml +++ b/domain-redis/src/main/resources/application-domain-redis.yaml @@ -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: diff --git a/domain/src/main/resources/application-domain.yaml b/domain/src/main/resources/application-domain.yaml index 6e92401..56cb413 100644 --- a/domain/src/main/resources/application-domain.yaml +++ b/domain/src/main/resources/application-domain.yaml @@ -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 @@ -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: