From 12dfc3e5c1d8b69cfec6f955586303b46195dd6d Mon Sep 17 00:00:00 2001 From: idaejin Date: Tue, 17 Sep 2024 21:44:58 +0900 Subject: [PATCH] =?UTF-8?q?#40=20-=20=ED=97=A4=EB=A1=9C=EC=BF=A0=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95=EC=9D=84=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 헤로쿠에 연동하기 위한 설정들을 가이드에 따라 넣고 헤로쿠에서 동작할 전용 스프링 부트 프로파일을 설정함. --- Procfile | 1 + build.gradle | 9 ++++++++- src/main/resources/application.yaml | 10 ++++++++++ system.properties | 1 + 4 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 Procfile create mode 100644 system.properties diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..71b455f --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: java $JAVA_OPTS -Dserver.port=$PORT -Dspring.profiles.active=heroku -jar build/libs/test-data-v1.0.jar \ No newline at end of file diff --git a/build.gradle b/build.gradle index e18fc4c..85b67d3 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { } group = 'org.leedae' -version = '0.0.1-SNAPSHOT' +version = 'v1.0' java { toolchain { @@ -44,3 +44,10 @@ tasks.named('test') { useJUnitPlatform() jvmArgs('-Xshare:off', '-XX:+EnableDynamicAgentLoading') } + +//heroku 설정 +jar{ + manifest { + attributes 'Main-Class': 'org.leedae.testdata.TestDataApplication' + } +} diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index f81e35c..9bfa826 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -33,3 +33,13 @@ spring: config.activate.on-profile: test datasource.url: jdbc:h2:mem:testdb;MODE=MySQL;DATABASE_TO_LOWER=TRUE + +--- +spring: + config.activate.on-profile: heroku + datasource: + url: ${JAWSDB_URL} + jpa: + hibernate.ddl-auto: create + defer-datasource-initialization: true + sql.init.mode: always \ No newline at end of file diff --git a/system.properties b/system.properties new file mode 100644 index 0000000..ec9df9a --- /dev/null +++ b/system.properties @@ -0,0 +1 @@ +java.runtime.version=21 \ No newline at end of file