From 228bc9acffb7484498320cba3912a8cbc22a78d7 Mon Sep 17 00:00:00 2001 From: ddongseop Date: Mon, 25 Sep 2023 00:35:02 +0900 Subject: [PATCH] =?UTF-8?q?[CHORE]=20yml=20=ED=8C=8C=EC=9D=BC=20=EB=B6=84?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/api-CD.yml | 2 +- .github/workflows/api-CI.yml | 2 +- .github/workflows/notification-CD.yml | 4 +- .github/workflows/notification-CI.yml | 2 +- scripts/umbba-notification/deploy.sh | 2 +- .../src/main/resources/application-local.yml | 54 +++++++++ .../src/main/resources/application-set1.yml | 54 +++++++++ .../src/main/resources/application-set2.yml | 54 +++++++++ umbba-api/src/main/resources/application.yml | 112 +---------------- umbba-api/src/main/resources/bootstrap.yml | 2 +- .../src/main/resources/application-dev.yml | 54 +++++++++ .../src/main/resources/application-local.yml | 54 +++++++++ .../src/main/resources/application.yml | 114 +----------------- .../src/main/resources/bootstrap.yml | 2 +- 14 files changed, 281 insertions(+), 231 deletions(-) create mode 100644 umbba-api/src/main/resources/application-local.yml create mode 100644 umbba-api/src/main/resources/application-set1.yml create mode 100644 umbba-api/src/main/resources/application-set2.yml create mode 100644 umbba-notification/src/main/resources/application-dev.yml create mode 100644 umbba-notification/src/main/resources/application-local.yml diff --git a/.github/workflows/api-CD.yml b/.github/workflows/api-CD.yml index 2c19a671..358142ad 100644 --- a/.github/workflows/api-CD.yml +++ b/.github/workflows/api-CD.yml @@ -49,7 +49,7 @@ jobs: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} aws-region: ap-northeast-2 - secrets: /secret/umbba-dev + secrets: /secret/umbba-secret parse-json: false # 4) FCM secret key 파일 생성 diff --git a/.github/workflows/api-CI.yml b/.github/workflows/api-CI.yml index 4dfc1830..32a1a18e 100644 --- a/.github/workflows/api-CI.yml +++ b/.github/workflows/api-CI.yml @@ -57,7 +57,7 @@ jobs: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} aws-region: ap-northeast-2 - secrets: /secret/umbba-dev + secrets: /secret/umbba-secret parse-json: false # 이 워크플로우는 gradle build diff --git a/.github/workflows/notification-CD.yml b/.github/workflows/notification-CD.yml index 46d75420..ea8b69c0 100644 --- a/.github/workflows/notification-CD.yml +++ b/.github/workflows/notification-CD.yml @@ -49,13 +49,13 @@ jobs: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} aws-region: ap-northeast-2 - secrets: /secret/umbba-dev + secrets: /secret/umbba-secret parse-json: false # 4) FCM secret key 파일 생성 - name: FCM secret key 파일 생성 run: | - cd ./umbba-api/src/main/resources + cd ./umbba-notification/src/main/resources mkdir ./firebase cd ./firebase diff --git a/.github/workflows/notification-CI.yml b/.github/workflows/notification-CI.yml index f0838dd2..7e2cf6fd 100644 --- a/.github/workflows/notification-CI.yml +++ b/.github/workflows/notification-CI.yml @@ -57,7 +57,7 @@ jobs: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} aws-region: ap-northeast-2 - secrets: /secret/umbba-dev + secrets: /secret/umbba-secret parse-json: false # 이 워크플로우는 gradle build diff --git a/scripts/umbba-notification/deploy.sh b/scripts/umbba-notification/deploy.sh index 0d815d0c..8024a227 100644 --- a/scripts/umbba-notification/deploy.sh +++ b/scripts/umbba-notification/deploy.sh @@ -14,6 +14,6 @@ if [ ! -z ${TARGET_PID} ]; then echo "[$NOW_TIME] 애플리케이션이 정상 종료되었습니다." fi -nohup java -jar -Duser.timezone=Asia/Seoul -Dspring.profiles.active=notification $BUILD_PATH >> /home/ubuntu/notification-server/deploy.log 2>/home/ubuntu/notification-server/deploy_err.log & +nohup java -jar -Duser.timezone=Asia/Seoul -Dspring.profiles.active=dev $BUILD_PATH >> /home/ubuntu/notification-server/deploy.log 2>/home/ubuntu/notification-server/deploy_err.log & echo "[$NOW_TIME] Now new WAS runs at ${TARGET_PORT}." >> /home/ubuntu/notification-server/deploy.log exit 0 \ No newline at end of file diff --git a/umbba-api/src/main/resources/application-local.yml b/umbba-api/src/main/resources/application-local.yml new file mode 100644 index 00000000..1ea9fcea --- /dev/null +++ b/umbba-api/src/main/resources/application-local.yml @@ -0,0 +1,54 @@ +spring: + config: + activate: + on-profile: local + + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: ${DB_URL_LOCAL} + username: ${DB_USER_LOCAL} + password: ${DB_PWD_LOCAL} + hikari: + pool-name: Hikari 커넥션 풀 # Pool + connection-timeout: 30000 # 30초(default: 30초) + maximum-pool-size: 10 # default: 10개 + max-lifetime: 600000 # 10분(default: 30분) + leak-detection-threshold: 3500 # default: 0(이용X) + + jpa: + show-sql: false + hibernate: + ddl-auto: update + ejb: + naming_strategy: org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy + properties: + hibernate: + format_sql: true + +cloud: + aws: + credentials: + accessKey: ${CLOUD_ACCESS_LOCAL} + secretKey: ${CLOUD_SECRET_LOCAL} + region: + static: ${CLOUD_REGION_LOCAL} + s3: + bucket: ${BUCKET_NAME_LOCAL} + stack: + auto: false + sqs: + notification: + name: ${SQS_NAME_LOCAL} + url: ${SQS_URL_LOCAL} + +server: + port: 9091 + +kakao: + client-id: ${KAKAO_ID} + authorization-grant-type: authorization_code + redirect-uri: ${KAKAO_REDIRECT_LOCAL} + +slack: + webhook: + url: ${SLACK_URL_LOCAL} \ No newline at end of file diff --git a/umbba-api/src/main/resources/application-set1.yml b/umbba-api/src/main/resources/application-set1.yml new file mode 100644 index 00000000..a924c93f --- /dev/null +++ b/umbba-api/src/main/resources/application-set1.yml @@ -0,0 +1,54 @@ +spring: + config: + activate: + on-profile: set1 + + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: ${DB_URL_DEV} + username: ${DB_USER_DEV} + password: ${DB_PWD_DEV} + hikari: + pool-name: Hikari 커넥션 풀 # Pool + connection-timeout: 30000 # 30초(default: 30초) + maximum-pool-size: 10 # default: 10개 + max-lifetime: 600000 # 10분(default: 30분) + leak-detection-threshold: 3500 # default: 0(이용X) + + jpa: + show-sql: false + hibernate: + ddl-auto: update + ejb: + naming_strategy: org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy + properties: + hibernate: + format_sql: true + +cloud: + aws: + credentials: + accessKey: ${CLOUD_ACCESS_DEV} + secretKey: ${CLOUD_SECRET_DEV} + region: + static: ${CLOUD_REGION_DEV} + s3: + bucket: ${BUCKET_NAME_DEV} + stack: + auto: false + sqs: + notification: + name: ${SQS_NAME_DEV} + url: ${SQS_URL_DEV} + +server: + port: 8081 + +kakao: + client-id: ${KAKAO_ID} + authorization-grant-type: authorization_code + redirect-uri: ${KAKAO_REDIRECT_DEV} + +slack: + webhook: + url: ${SLACK_URL_DEV} \ No newline at end of file diff --git a/umbba-api/src/main/resources/application-set2.yml b/umbba-api/src/main/resources/application-set2.yml new file mode 100644 index 00000000..1d537832 --- /dev/null +++ b/umbba-api/src/main/resources/application-set2.yml @@ -0,0 +1,54 @@ +spring: + config: + activate: + on-profile: set2 + + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: ${DB_URL_DEV} + username: ${DB_USER_DEV} + password: ${DB_PWD_DEV} + hikari: + pool-name: Hikari 커넥션 풀 # Pool + connection-timeout: 30000 # 30초(default: 30초) + maximum-pool-size: 10 # default: 10개 + max-lifetime: 600000 # 10분(default: 30분) + leak-detection-threshold: 3500 # default: 0(이용X) + + jpa: + show-sql: false + hibernate: + ddl-auto: update + ejb: + naming_strategy: org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy + properties: + hibernate: + format_sql: true + +cloud: + aws: + credentials: + accessKey: ${CLOUD_ACCESS_DEV} + secretKey: ${CLOUD_SECRET_DEV} + region: + static: ${CLOUD_REGION_DEV} + s3: + bucket: ${BUCKET_NAME_DEV} + stack: + auto: false + sqs: + notification: + name: ${SQS_NAME_DEV} + url: ${SQS_URL_DEV} + +server: + port: 8082 + +kakao: + client-id: ${KAKAO_ID} + authorization-grant-type: authorization_code + redirect-uri: ${KAKAO_REDIRECT_DEV} + +slack: + webhook: + url: ${SLACK_URL_DEV} \ No newline at end of file diff --git a/umbba-api/src/main/resources/application.yml b/umbba-api/src/main/resources/application.yml index e6da44be..b0c4554e 100644 --- a/umbba-api/src/main/resources/application.yml +++ b/umbba-api/src/main/resources/application.yml @@ -1,74 +1,14 @@ spring: profiles: - group: - "local": "local_setting, common" - "local_notification": "local_notification_setting, common" - "set1": "set1_setting, common" - "set2": "set2_setting, common" - "notification": "notification_setting, common" active: local -# common ---- -spring: - config: - activate: - on-profile: common - - datasource: - driver-class-name: com.mysql.cj.jdbc.Driver - url: ${DB_URL} - username: ${DB_USER} - password: ${DB_PWD} - hikari: - pool-name: Hikari 커넥션 풀 # Pool - connection-timeout: 30000 # 30초(default: 30초) - maximum-pool-size: 10 # default: 10개 - max-lifetime: 600000 # 10분(default: 30분) - leak-detection-threshold: 3500 # default: 0(이용X) - - jpa: - show-sql: false - hibernate: - ddl-auto: update - ejb: - naming_strategy: org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy - properties: - hibernate: - format_sql: true - -cloud: - aws: - credentials: - accessKey: ${CLOUD_ACCESS} - secretKey: ${CLOUD_SECRET} - region: - static: ${CLOUD_REGION} - s3: - bucket: ${BUCKET_NAME} - stack: - auto: false - sqs: - notification: - name: ${SQS_NOTIFICATION_NAME} - url: ${SQS_NOTIFICATION_URL} - -kakao: - client-id: ${KAKAO_ID} - authorization-grant-type: authorization_code - redirect-uri: ${KAKAO_REDIRECT} apple: iss: ${APPLE_ISS} client-id: ${APPLE_ID} -# nonce: jwt: secret: ${JWT_SECRET} -slack: - webhook: - url: ${SLACK_URL} - fcm: key: path: ${FCM_JSON_PATH} @@ -84,54 +24,4 @@ logging: com: amazonaws: util: - EC2MetadataUtils: error - -# local_setting ---- -spring: - config: - activate: - on-profile: local_setting - -server: - port: 9091 - -# local_notification_setting ---- -spring: - config: - activate: - on-profile: local_notification_setting - -server: - port: 9092 - -# set1_setting ---- -spring: - config: - activate: - on-profile: set1_setting - -server: - port: 8081 - -# set2_setting ---- -spring: - config: - activate: - on-profile: set2_setting - -server: - port: 8082 - -# notification_setting ---- -spring: - config: - activate: - on-profile: notification_setting - -server: - port: 8083 \ No newline at end of file + EC2MetadataUtils: error \ No newline at end of file diff --git a/umbba-api/src/main/resources/bootstrap.yml b/umbba-api/src/main/resources/bootstrap.yml index 25cfe945..b03fe132 100644 --- a/umbba-api/src/main/resources/bootstrap.yml +++ b/umbba-api/src/main/resources/bootstrap.yml @@ -1,6 +1,6 @@ aws: secretsmanager: - name: umbba-dev + name: umbba-secret cloud: aws: region: diff --git a/umbba-notification/src/main/resources/application-dev.yml b/umbba-notification/src/main/resources/application-dev.yml new file mode 100644 index 00000000..7f9683e2 --- /dev/null +++ b/umbba-notification/src/main/resources/application-dev.yml @@ -0,0 +1,54 @@ +spring: + config: + activate: + on-profile: dev + + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: ${DB_URL_DEV} + username: ${DB_USER_DEV} + password: ${DB_PWD_DEV} + hikari: + pool-name: Hikari 커넥션 풀 # Pool + connection-timeout: 30000 # 30초(default: 30초) + maximum-pool-size: 10 # default: 10개 + max-lifetime: 600000 # 10분(default: 30분) + leak-detection-threshold: 3500 # default: 0(이용X) + + jpa: + show-sql: false + hibernate: + ddl-auto: update + ejb: + naming_strategy: org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy + properties: + hibernate: + format_sql: true + +cloud: + aws: + credentials: + accessKey: ${CLOUD_ACCESS_DEV} + secretKey: ${CLOUD_SECRET_DEV} + region: + static: ${CLOUD_REGION_DEV} + s3: + bucket: ${BUCKET_NAME_DEV} + stack: + auto: false + sqs: + notification: + name: ${SQS_NAME_DEV} + url: ${SQS_URL_DEV} + +server: + port: 8083 + +kakao: + client-id: ${KAKAO_ID} + authorization-grant-type: authorization_code + redirect-uri: ${KAKAO_REDIRECT_DEV} + +slack: + webhook: + url: ${SLACK_URL_DEV} \ No newline at end of file diff --git a/umbba-notification/src/main/resources/application-local.yml b/umbba-notification/src/main/resources/application-local.yml new file mode 100644 index 00000000..145b60a6 --- /dev/null +++ b/umbba-notification/src/main/resources/application-local.yml @@ -0,0 +1,54 @@ +spring: + config: + activate: + on-profile: local + + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: ${DB_URL_LOCAL} + username: ${DB_USER_LOCAL} + password: ${DB_PWD_LOCAL} + hikari: + pool-name: Hikari 커넥션 풀 # Pool + connection-timeout: 30000 # 30초(default: 30초) + maximum-pool-size: 10 # default: 10개 + max-lifetime: 600000 # 10분(default: 30분) + leak-detection-threshold: 3500 # default: 0(이용X) + + jpa: + show-sql: false + hibernate: + ddl-auto: update + ejb: + naming_strategy: org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy + properties: + hibernate: + format_sql: true + +cloud: + aws: + credentials: + accessKey: ${CLOUD_ACCESS_LOCAL} + secretKey: ${CLOUD_SECRET_LOCAL} + region: + static: ${CLOUD_REGION_LOCAL} + s3: + bucket: ${BUCKET_NAME_LOCAL} + stack: + auto: false + sqs: + notification: + name: ${SQS_NAME_LOCAL} + url: ${SQS_URL_LOCAL} + +server: + port: 9092 + +kakao: + client-id: ${KAKAO_ID} + authorization-grant-type: authorization_code + redirect-uri: ${KAKAO_REDIRECT_LOCAL} + +slack: + webhook: + url: ${SLACK_URL_LOCAL} \ No newline at end of file diff --git a/umbba-notification/src/main/resources/application.yml b/umbba-notification/src/main/resources/application.yml index 9ff99358..b0c4554e 100644 --- a/umbba-notification/src/main/resources/application.yml +++ b/umbba-notification/src/main/resources/application.yml @@ -1,74 +1,14 @@ spring: profiles: - group: - "local": "local_setting, common" - "local_notification": "local_notification_setting, common" - "set1": "set1_setting, common" - "set2": "set2_setting, common" - "notification": "notification_setting, common" - active: local_notification + active: local -# common ---- -spring: - config: - activate: - on-profile: common - - datasource: - driver-class-name: com.mysql.cj.jdbc.Driver - url: ${DB_URL} - username: ${DB_USER} - password: ${DB_PWD} - hikari: - pool-name: Hikari 커넥션 풀 # Pool - connection-timeout: 30000 # 30초(default: 30초) - maximum-pool-size: 10 # default: 10개 - max-lifetime: 600000 # 10분(default: 30분) - leak-detection-threshold: 3500 # default: 0(이용X) - - jpa: - show-sql: false - hibernate: - ddl-auto: update - ejb: - naming_strategy: org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy - properties: - hibernate: - format_sql: true - -cloud: - aws: - credentials: - accessKey: ${CLOUD_ACCESS} - secretKey: ${CLOUD_SECRET} - region: - static: ${CLOUD_REGION} - s3: - bucket: ${BUCKET_NAME} - stack: - auto: false - sqs: - notification: - name: ${SQS_NOTIFICATION_NAME} - url: ${SQS_NOTIFICATION_URL} - -kakao: - client-id: ${KAKAO_ID} - authorization-grant-type: authorization_code - redirect-uri: ${KAKAO_REDIRECT} apple: iss: ${APPLE_ISS} client-id: ${APPLE_ID} -# nonce: jwt: secret: ${JWT_SECRET} -slack: - webhook: - url: ${SLACK_URL} - fcm: key: path: ${FCM_JSON_PATH} @@ -84,54 +24,4 @@ logging: com: amazonaws: util: - EC2MetadataUtils: error - -# local_setting ---- -spring: - config: - activate: - on-profile: local_setting - -server: - port: 9091 - -# local_notification_setting ---- -spring: - config: - activate: - on-profile: local_notification_setting - -server: - port: 9092 - -# set1_setting ---- -spring: - config: - activate: - on-profile: set1_setting - -server: - port: 8081 - -# set2_setting ---- -spring: - config: - activate: - on-profile: set2_setting - -server: - port: 8082 - -# notification_setting ---- -spring: - config: - activate: - on-profile: notification_setting - -server: - port: 8083 \ No newline at end of file + EC2MetadataUtils: error \ No newline at end of file diff --git a/umbba-notification/src/main/resources/bootstrap.yml b/umbba-notification/src/main/resources/bootstrap.yml index 25cfe945..b03fe132 100644 --- a/umbba-notification/src/main/resources/bootstrap.yml +++ b/umbba-notification/src/main/resources/bootstrap.yml @@ -1,6 +1,6 @@ aws: secretsmanager: - name: umbba-dev + name: umbba-secret cloud: aws: region: