Skip to content

Commit

Permalink
application-dev.yml, application-local.yml 분리 (Issue #163) (#164)
Browse files Browse the repository at this point in the history
* refactor: application-dev.yml, application-local.yml 분리

* fix: cd 스크립트에 프로파일 설정 추가
  • Loading branch information
robinjoon authored Jul 26, 2024
1 parent 10d1a54 commit 0ce22c4
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 50 deletions.
1 change: 1 addition & 0 deletions .github/workflows/backend_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ jobs:
sudo nohup java \
-Dauth.github.client-id=${{ secrets.CLIENT_ID_GITHUB }} \
-Dauth.github.client-secret=${{ secrets.CLIENT_SECRET_GITHUB }} \
--spring.profiles.active=dev \
-jar ${{ env.ARTIFACT_DIRECTORY }}/${{ env.ARTIFACT_NAME }}.jar \
--server.port=80 &
Expand Down
39 changes: 39 additions & 0 deletions backend/src/main/resources/application-common.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
spring:
h2:
console:
enabled: true
path: /h2-console
datasource:
url: jdbc:h2:mem:database;
driver-class-name: org.h2.Driver
jpa:
show-sql: true
defer-datasource-initialization: true
properties:
hibernate:
format_sql: true
highlight_sql: true
hibernate:
ddl-auto: create

springdoc:
default-consumes-media-type: application/json
default-produces-media-type: application/json
swagger-ui:
path: /api-docs
disable-swagger-default-url: true
display-request-duration: true
operations-sorter: alpha
tags-sorter: alpha

logging:
level:
org.springframework.orm.jpa: DEBUG
org.springframework.orm.transaction: DEBUG
org.hibernate.SQL: debug
org.hibernate.orm.jdbc.bind: trace

security:
jwt:
secret-key: 7b3dc341c033816045cc11c6f9fba3187f4dbdb7
expiration-time: 3600000 # 1 hour
9 changes: 9 additions & 0 deletions backend/src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
api-host: http://3.38.80.28
client-host: http://3.38.11.109

auth:
github:
client-id: develup-test-develup-test-develup-test-develup-test-develup-test
client-secret: develup-test-develup-test-develup-test-develup-test-develup-test
redirect-uri: ${api-host}/auth/social/callback/github
client-uri: ${client-host}
9 changes: 9 additions & 0 deletions backend/src/main/resources/application-local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
api-host: http://localhost:8080
client-host: http://localhost:3000

auth:
github:
client-id: develup-test-develup-test-develup-test-develup-test-develup-test
client-secret: develup-test-develup-test-develup-test-develup-test-develup-test
redirect-uri: ${api-host}/auth/social/callback/github
client-uri: ${client-host}
52 changes: 4 additions & 48 deletions backend/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,5 @@
spring:
h2:
console:
enabled: true
path: /h2-console
datasource:
url: jdbc:h2:mem:database;
driver-class-name: org.h2.Driver
jpa:
show-sql: true
defer-datasource-initialization: true
properties:
hibernate:
format_sql: true
highlight_sql: true
hibernate:
ddl-auto: create

springdoc:
default-consumes-media-type: application/json
default-produces-media-type: application/json
swagger-ui:
path: /api-docs
disable-swagger-default-url: true
display-request-duration: true
operations-sorter: alpha
tags-sorter: alpha

logging:
level:
org.springframework.orm.jpa: DEBUG
org.springframework.orm.transaction: DEBUG
org.hibernate.SQL: debug
org.hibernate.orm.jdbc.bind: trace

api-host: http://localhost:8080
client-host: http://localhost:3000

auth:
github:
client-id: develup-test-develup-test-develup-test-develup-test-develup-test
client-secret: develup-test-develup-test-develup-test-develup-test-develup-test
redirect-uri: ${api-host}/auth/social/callback/github
client-uri: ${client-host}

security:
jwt:
secret-key: 7b3dc341c033816045cc11c6f9fba3187f4dbdb7
expiration-time: 3600000 # 1 hour
profiles:
group:
local: local, common
dev: dev, common
4 changes: 2 additions & 2 deletions backend/src/main/resources/data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ VALUES ('[email protected]', 'GITHUB', '1234', '구름', 'www.naver.com');
INSERT INTO member (email, provider, social_id, name, image_url)
VALUES ('[email protected]', 'GITHUB', '1234', '리브', 'www.naver.com');

INSERT INTO member (id, email, provider, social_id, name, image_url)
VALUES (3, '[email protected]', 'GITHUB', '1234', '아톰', 'www.naver.com');
INSERT INTO member (email, provider, social_id, name, image_url)
VALUES ('[email protected]', 'GITHUB', '1234', '아톰', 'www.naver.com');

INSERT INTO submission (member_id, mission_id, url, comment)
VALUES (1, 1, 'https://github.com/develup-mission/java-smoking/pull/1', '코멘트 1');
Expand Down

0 comments on commit 0ce22c4

Please sign in to comment.