Skip to content

Commit

Permalink
Merge pull request #199 from Katchup-dev/setting/#197/resources
Browse files Browse the repository at this point in the history
[SETTING] 설정 파일 수정
  • Loading branch information
unanchoi authored Nov 8, 2023
2 parents ec45c4b + e7c3058 commit 25aab41
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 25 deletions.
26 changes: 3 additions & 23 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,12 @@ jobs:
distribution: 'corretto'
cache: gradle

- name: create application-aws file
- name: set environment variables
working-directory: ./
run: |
pwd
mkdir src/main/resources
touch src/main/resources/application-aws.yml
echo AWS_ACCESS_KEY=${{ secrets.AWS_ACCESS_KEY }} >> src/main/resources/application-aws.yml
echo AWS_REGION=${{ secrets.AWS_REGION }} >> src/main/resources/application-aws.yml
echo AWS_SECRET_KEY=${{ secrets.AWS_SECRET_KEY }} >> src/main/resources/application-aws.yml
echo S3_BUCKET=${{ secrets.S3_BUCKET }} >> src/main/resources/application-aws.yml
cat src/main/resources/application-aws.yml
- name: create .env file
working-directory: ./
run: |
pwd
touch .env
echo "${{ secrets.ENV }}" >> .env
cat .env
- name: Create application.yml
run: |
pwd
touch src/main/resources/application.yml
echo "${{ secrets.APPLICATION_YML }}" >> src/main/resources/application.yml
cat src/main/resources/application.yml
touch src/main/resources/application-secret.properties
echo ${{ secrets.ENV }} >> src/main/resources/application-secret.properties
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ ide
.vscode/
.env

resources/
.jpb/

application-secret.properties
.DS_Store
54 changes: 54 additions & 0 deletions src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
server:
port: 8080

spring:
config:
activate:
on-profile: dev
import: application-secret.properties
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://${DEV_DB_ENDPOINT_URL}:3306/${DEV_DB_NAME}?serverTimezone=Asia/Seoul
username: ${DEV_DB_USER}
password: ${DEV_DB_PASSWORD}
jpa:
generate-ddl: true
hibernate:
ddl-auto:
properties:
hibernate:
show_sql: true
format_sql:
dialect: org.hibernate.dialect.MySQLDialect
storage_engine: innodb


logging:
level:
org.hibernate.SQL: debug
org.hibernate.type: trace

aws-property:
aws-region: ${AWS_REGION}
s3-bucket-name: ${AWS_BUCKET_NAME}
access-key: ${AWS_ACCESS_KEY}
secret-key: ${AWS_SECRET_KEY}

jwt:
header: Authorization
secret: ${JWT_SECRET}
access-token:
expire-length: ${ACCESS_TOKEN_EXPIRED_TIME} # 10분
refresh-token:
expire-length: ${REFRESH_TOKEN_EXPIRED_TIME} # 2시간
springdoc:
packages-to-scan: site.katchup.katchupserver
default-consumes-media-type: application/json;charset=UTF-8
default-produces-media-type: application/json;charset=UTF-8
swagger-ui:
tags-sorter: alpha
operations-sorter: alpha
api-docs:
path: /api-docs/json
groups:
enabled: true
37 changes: 37 additions & 0 deletions src/main/resources/application-local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
spring:
config:
activate:
on-profile: local
import: application-secret.properties
datasource:
url: jdbc:h2:tcp://localhost/~/test;DATABASE_TO_UPPER=false;MODE=MYSQL
username: sa
password:
driver-class-name: org.h2.Driver
jpa:
hibernate:
ddl-auto: create
properties:
hibernate:
show_sql: true
format_sql:
dialect: org.hibernate.dialect.H2Dialect

logging:
level:
org.hibernate.SQL: debug
org.hibernate.type: trace

jwt:
header: Authorization
secret: ${JWT_SECRET}
access-token:
expire-length: ${ACCESS_TOKEN_EXPIRED_TIME} # 10분
refresh-token:
expire-length: ${REFRESH_TOKEN_EXPIRED_TIME} # 2시간

aws-property:
aws-region: ${AWS_REGION}
s3-bucket-name: ${AWS_BUCKET_NAME}
access-key: ${AWS_ACCESS_KEY}
secret-key: ${AWS_SECRET_KEY}

0 comments on commit 25aab41

Please sign in to comment.