Skip to content

Commit

Permalink
setting(#445): Configure database dependencies for dev and local prof…
Browse files Browse the repository at this point in the history
…iles
  • Loading branch information
ImKunYoung committed Nov 29, 2023
1 parent 7b443d7 commit b499b39
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 11 deletions.
9 changes: 6 additions & 3 deletions liberty-auth-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ ext {
set('springCloudVersion', "2022.0.1")
}

if (project.hasProperty("dev")) {
apply from: "gradle/profile_dev.gradle"
} else {
apply from: "gradle/profile_local.gradle"
}

dependencies {
implementation(project(":liberty-common"))

Expand All @@ -32,11 +38,8 @@ dependencies {
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0'

compileOnly 'org.projectlombok:lombok'
runtimeOnly 'com.h2database:h2'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.security:spring-security-test'
testImplementation group: 'org.testcontainers', name: 'testcontainers', version: '1.17.2'

testImplementation 'com.tngtech.archunit:archunit:1.1.0'
}

Expand Down
3 changes: 3 additions & 0 deletions liberty-auth-service/gradle/profile_dev.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dependencies {
implementation 'org.mariadb.jdbc:mariadb-java-client:3.3.0'
}
4 changes: 4 additions & 0 deletions liberty-auth-service/gradle/profile_local.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dependencies {
runtimeOnly 'com.h2database:h2'
testImplementation group: 'org.testcontainers', name: 'testcontainers', version: '1.17.2'
}
9 changes: 1 addition & 8 deletions liberty-auth-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,4 @@ spring:
- optional:configserver:http://config-server.liberty52.com:8888/
cloud:
config:
label: main
jpa:
defer-datasource-initialization: true
sql:
init:
mode: always
encoding: UTF-8
data-locations: classpath:db/seed.sql
label: main
19 changes: 19 additions & 0 deletions liberty-auth-service/src/main/resources/db/mariadb/seed.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
INSERT INTO auth (ID, CREATED_AT, EMAIL, NAME, PASSWORD, PW_MODIFIY_REQUEST_DATE, PHONE_NUMBER, PROFILE_URL, REFRESH_TOKEN, ROLE) VALUES ('TESTER-001', '2023-11-23', '[email protected]', '김테스터', '{bcrypt}$2a$10$vTfb3UhXZKTrkafh0dYT.OmSToczwbtXl5HuqzzveBFN2GH03lwCi', '2024-05-23', '010-0101-0101', null, null, 'USER');
INSERT INTO auth (ID, CREATED_AT, EMAIL, NAME, PASSWORD, PW_MODIFIY_REQUEST_DATE, PHONE_NUMBER, PROFILE_URL, REFRESH_TOKEN, ROLE) VALUES ('ADMIN-001', '2023-11-23', 'admin', '관리자', '{bcrypt}$2a$10$YUvP/fXS2BIewyFhXf3mxOdXyLmUtR7WYujIGOZEH.l2VM3rvixDu', '2024-05-23', '01012341234', null, null, 'ADMIN');
INSERT INTO auth (ID, CREATED_AT, EMAIL, NAME, PASSWORD, PW_MODIFIY_REQUEST_DATE, PHONE_NUMBER, PROFILE_URL, REFRESH_TOKEN, ROLE) VALUES ('ADMIN-002', '2023-11-23', '[email protected]', 'OMNM_관리자', '{bcrypt}$2a$10$7V2CqVoZGwMb3I.RN0qwiuIEI1oLZjAUwOBLF1t1Wrt2mt2DJYDWm', '2024-05-23', '01043214321', null, null, 'ADMIN');
INSERT INTO auth (ID, CREATED_AT, EMAIL, NAME, PASSWORD, PW_MODIFIY_REQUEST_DATE, PHONE_NUMBER, PROFILE_URL, REFRESH_TOKEN, ROLE) VALUES ('ADMIN-003', '2023-11-23', '[email protected]', 'LIBERTY_관리자', '{bcrypt}$2a$10$.RAJq80gJz6jL6mtbN8wGeB9fUKxmB056EqKFCfmUowibjDclp4C.', '2024-05-23', '01078900987', null, null, 'ADMIN');


INSERT INTO notice (ID, COMMENTABLE, CONTENT, CREATED_AT, TITLE) VALUES ('NOTICE-000', false, 'Notice-Content-0', '2023-11-23 06:13:45.314689', '[이벤트] Liberty52 Frame 포토 리뷰 작성 이벤트0');
INSERT INTO notice (ID, COMMENTABLE, CONTENT, CREATED_AT, TITLE) VALUES ('NOTICE-001', false, 'Notice-Content-1', '2023-11-23 06:13:45.316202', '[이벤트] Liberty52 Frame 포토 리뷰 작성 이벤트1');
INSERT INTO notice (ID, COMMENTABLE, CONTENT, CREATED_AT, TITLE) VALUES ('NOTICE-002', false, 'Notice-Content-2', '2023-11-23 06:13:45.317224', '[이벤트] Liberty52 Frame 포토 리뷰 작성 이벤트2');


INSERT INTO question (ID, CONTENT, CREATED_AT, STATUS, TITLE, WRITER_ID) VALUES ('QUESTION-001', 'this is content', '2023-11-23 06:13:45.021626', 'DONE', 'this is title', 'TESTER-001');



INSERT INTO question_reply (ID, CONTENT, CREATED_AT, WRITER_ID, QUESTION_ID) VALUES ('QUESTION-REPLY-001', 'this is reply content', '2023-11-23 06:13:45.021626', 'ADMIN-001', 'QUESTION-001');



0 comments on commit b499b39

Please sign in to comment.