diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..b8f1d14 --- /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 diff --git a/build.gradle b/build.gradle index 7f33e8f..511dc1f 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { } group = 'uno.fastcampus' -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': 'uno.fastcampus.testdata.TestDataApplication') + } +} diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 707e6ea..4eff915 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -32,3 +32,14 @@ spring: 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..5a9b50d --- /dev/null +++ b/system.properties @@ -0,0 +1 @@ +java.runtime.version=21