From bf1954cfa5daf2804fe3715bdb653115e7971b35 Mon Sep 17 00:00:00 2001 From: haerong22 Date: Fri, 26 Aug 2022 03:27:49 +0900 Subject: [PATCH] #16 board : heroku settings --- board/Procfile | 2 ++ board/build.gradle | 9 ++++++++- board/src/main/resources/application.yaml | 12 +++++++++++- board/system.properties | 1 + 4 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 board/Procfile create mode 100644 board/system.properties diff --git a/board/Procfile b/board/Procfile new file mode 100644 index 00000000..13cfb312 --- /dev/null +++ b/board/Procfile @@ -0,0 +1,2 @@ + +web: java $JAVA_OPTS -Dserver.port=$PORT -Dspring.profiles.active=heroku -jar build/libs/board-v1.0.jar diff --git a/board/build.gradle b/board/build.gradle index d56d6058..a5c18818 100644 --- a/board/build.gradle +++ b/board/build.gradle @@ -5,7 +5,7 @@ plugins { } group = 'com.example' -version = '0.0.1-SNAPSHOT' +version = 'v.1.0' sourceCompatibility = '17' configurations { @@ -68,4 +68,11 @@ sourceSets { // gradle clean 시에 QClass 디렉토리 삭제 clean { delete file(generated) +} + +// Heroku 설정 +jar { + manifest { + attributes('Main-Class': 'com.example.board.BoardApplication') + } } \ No newline at end of file diff --git a/board/src/main/resources/application.yaml b/board/src/main/resources/application.yaml index 03903347..c9a04351 100644 --- a/board/src/main/resources/application.yaml +++ b/board/src/main/resources/application.yaml @@ -40,4 +40,14 @@ spring: # url: jdbc:h2:mem:board;mode=mysql # driver-class-name: org.h2.Driver # sql.init.mode: always -# test.database.replace: none \ No newline at end of file +# test.database.replace: none + +--- + +spring: + config.activate.on-profile: heroku + datasource: + url: ${JAWSDB_URL} + driver-class-name: com.mysql.cj.jdbc.Driver + jpa.hibernate.ddl-auto: create + sql.init.mode: always \ No newline at end of file diff --git a/board/system.properties b/board/system.properties new file mode 100644 index 00000000..0dc726ce --- /dev/null +++ b/board/system.properties @@ -0,0 +1 @@ +java.runtime.version=17 \ No newline at end of file