Skip to content

Commit

Permalink
[CHORE] yml 파일 분리
Browse files Browse the repository at this point in the history
  • Loading branch information
ddongseop committed Sep 24, 2023
1 parent 74069be commit 228bc9a
Show file tree
Hide file tree
Showing 14 changed files with 281 additions and 231 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/api-CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 파일 생성
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/api-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/notification-CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/notification-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/umbba-notification/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
54 changes: 54 additions & 0 deletions umbba-api/src/main/resources/application-local.yml
Original file line number Diff line number Diff line change
@@ -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}
54 changes: 54 additions & 0 deletions umbba-api/src/main/resources/application-set1.yml
Original file line number Diff line number Diff line change
@@ -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}
54 changes: 54 additions & 0 deletions umbba-api/src/main/resources/application-set2.yml
Original file line number Diff line number Diff line change
@@ -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}
112 changes: 1 addition & 111 deletions umbba-api/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -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}
Expand All @@ -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
EC2MetadataUtils: error
2 changes: 1 addition & 1 deletion umbba-api/src/main/resources/bootstrap.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
aws:
secretsmanager:
name: umbba-dev
name: umbba-secret
cloud:
aws:
region:
Expand Down
Loading

0 comments on commit 228bc9a

Please sign in to comment.