Skip to content

Commit

Permalink
[HOTFIX] 환경변수 주입 방식 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
yummygyudon committed Nov 29, 2024
1 parent 93ddb14 commit 8789ca9
Show file tree
Hide file tree
Showing 6 changed files with 196 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/cd-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,12 @@ jobs:
s3://$S3_BUCKET/dev/script/switch.sh ./script/switch.sh
aws s3 cp --region $REGION \
s3://$S3_BUCKET/dev/script/valid.sh ./script/valid.sh
aws s3 cp --region $REGION \
s3://$S3_BUCKET/dev/dev.env application.env
- name: Make zip file
run: zip -r ./$GITHUB_SHA.zip ./script ./appspec.yml
run: zip -r ./$GITHUB_SHA.zip ./script ./appspec.yml ./application.env
shell: bash

- name: Upload Property Zip to S3 and Create Code Deploy
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ out/
### VS Code ###
.vscode/

### config yml ###
application-**.yml
*.env

*/src/main/generated
scripts
2 changes: 2 additions & 0 deletions appspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ files:
- source: script/valid.sh
destination: /home/ubuntu/script/op/valid.sh
overwrite: yes
- source: application.env
destination: /home/ubuntu/env/op/application.env

file_exists_behavior: OVERWRITE

Expand Down
92 changes: 92 additions & 0 deletions operation-api/src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
spring:
config:
activate:
on-profile: dev
import: optional:file:.env[.properties]

flyway:
enabled: true
baseline-on-migrate: true

datasource:
driver-class-name: ${DB_DRIVER_CLASS_NAME}
url: ${DB_URL}
username: ${DB_USERNAME}
password: ${DB_PASSWORD}

jpa:
hibernate:
ddl-auto: none
globally_quoted_identifiers: true
properties:
hibernate:
format_sql: true
show_sql: true
database-platform: org.hibernate.dialect.PostgreSQLDialect
database: postgresql

jwt:
secretKey:
app: ${JWT_SECRET_KEY_APP}
access: ${JWT_SECRET_KEY_ACCESS}
refresh: ${JWT_SECRET_KEY_REFRESH}
platform_code: ${JWT_SECRET_PLATFORM_CODE}
secretKey:
playground: ${SECRET_KEY_PG}

sopt:
current:
generation: ${SOPT_CURRENT_GENERATION}
makers:
playground:
server: ${SOPT_MAKER_PG_URL}
token: ${SOPT_MAKER_PG_TOKEN}
alarm:
message:
title_end: ${SOPT_ALARM_MESSAGE_TITLE} # (세션명) 출석점수 반영
content_end: ${SOPT_ALARM_MESSAGE_CONTENT}

admin:
url:
prod: ${ADMIN_URL_PROD}
dev: ${ADMIN_URL_DEV}
local: ${ADMIN_URL_LOCAL}

notification:
url: ${NOTIFICATION_URL}
key: ${NOTIFICATION_KEY}
arn: ${NOTIFICATION_ARN}

springdoc:
swagger-ui:
path: /swagger-ui.html

oauth:
apple:
aud: ${OAUTH_APPLE_AUD}
sub: ${OAUTH_APPLE_SUB}
key:
id: ${OAUTH_APPLE_KEY_ID}
path: ${OAUTH_APPLE_KEY_PATH}
team:
id: ${OAUTH_APPLE_TEAM_ID}
google:
redirect:
url: ${OAUTH_GOOGLE_REDIRECT_URL}
client:
id: ${OAUTH_GOOGLE_CLIENT_ID}
secret: ${OAUTH_GOOGLE_CLIENT_SECRET}

cloud:
aws:
credentials:
accessKey: ${AWS_CREDENTIALS_ACCESS_KEY}
secretKey: ${AWS_CREDENTIALS_ACCESS_KEY}
eventBridge:
roleArn: ${AWS_CREDENTIALS_EVENTBRIDGE_ROLE_ARN}

management:
endpoints:
web:
exposure:
include: health
68 changes: 68 additions & 0 deletions operation-api/src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
spring:
config:
activate:
on-profile: prod
import: optional:file:.env[.properties]

flyway:
enabled: true
baseline-on-migrate: true

datasource:
driver-class-name: ${DB_DRIVER_CLASS_NAME}
url: ${DB_URL}
username: ${DB_USERNAME}
password: ${DB_PASSWORD}

jpa:
hibernate:
ddl-auto: none
globally_quoted_identifiers: true
properties:
hibernate:
format_sql: true
show_sql: true
database-platform: org.hibernate.dialect.PostgreSQLDialect
database: postgresql

jwt:
secretKey:
app: ${JWT_SECRET_KEY_APP}
access: ${JWT_SECRET_KEY_ACCESS}
refresh: ${JWT_SECRET_KEY_REFRESH}
secretKey:
playground: ${SECRET_KEY_PG}

sopt:
current:
generation: ${SOPT_CURRENT_GENERATION}
makers:
playground:
server: ${SOPT_MAKER_PG_URL}
token: ${SOPT_MAKER_PG_TOKEN}
alarm:
message:
title_end: ${SOPT_ALARM_MESSAGE_TITLE} # (세션명) 출석점수 반영
content_end: ${SOPT_ALARM_MESSAGE_CONTENT}

admin:
url:
prod_legacy: ${ADMIN_URL_PROD_LEGACY}
dev_legacy: ${ADMIN_URL_DEV_LEGACY}
prod: ${ADMIN_URL_PROD}
dev: ${ADMIN_URL_DEV}
local: ${ADMIN_URL_LOCAL}

notification:
url: ${NOTIFICATION_URL}
key: ${NOTIFICATION_KEY}

springdoc:
swagger-ui:
path: /swagger-ui.html

management:
endpoints:
web:
exposure:
include: health
29 changes: 29 additions & 0 deletions operation-domain/src/test/resources/application-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
spring:
config:
activate:
on-profile: test
datasource:
username: sa
password:
driver-class-name: org.h2.Driver
url: jdbc:h2:mem:test;DATABASE_TO_LOWER=true;MODE=PostgreSQL
jpa:
hibernate:
ddl-auto: update # create-drop 이나 create로 할경우, 자동으로 실행되는 schema & table drop 에서 DDL 오류 발생 (not exist -> not found)
properties:
hibernate.dialect: org.hibernate.dialect.PostgreSQLDialect
hibernate:
format_sql: true
globally_quoted_identifiers: true
show_sql: true
show-sql: true
generate-ddl: true

logging:
level:
org:
hibernate:
SQL: DEBUG
type:
descriptor:
sql: trace

0 comments on commit 8789ca9

Please sign in to comment.