forked from dimplekataria01/pal-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
48 lines (38 loc) · 1.36 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import org.flywaydb.gradle.task.FlywayMigrateTask
plugins {
id "java"
id "org.springframework.boot" version "1.5.4.RELEASE"
id "org.flywaydb.flyway" version "4.2.0"
}
repositories {
mavenCentral()
}
dependencies {
compile("org.springframework.boot:spring-boot-starter-web")
compile("org.springframework.boot:spring-boot-starter-jdbc")
compile("org.mariadb.jdbc:mariadb-java-client:2.0.2")
compile("org.springframework.boot:spring-boot-starter-actuator")
compile("org.springframework.boot:spring-boot-starter-security")
testCompile("org.springframework.boot:spring-boot-starter-test")
}
def developmentDbUrl = "jdbc:mariadb://localhost:3306/tracker_dev?user=tracker"
bootRun.environment([
"WELCOME_MESSAGE": "hello",
"SPRING_DATASOURCE_URL": "jdbc:mariadb://localhost:3306/tracker_dev?user=tracker",
"MANAGEMENT_SECURITY_ENABLED": false,
])
def testDbUrl = "jdbc:mariadb://localhost:3306/tracker_test?user=tracker"
test.environment([
"WELCOME_MESSAGE": "Hello from test",
"SPRING_DATASOURCE_URL": "jdbc:mariadb://localhost:3306/tracker_test?user=tracker",
"MANAGEMENT_SECURITY_ENABLED": false,
])
flyway {
url = developmentDbUrl
user = "tracker"
password = ""
locations = ["filesystem:databases/tracker/migrations"]
}
task testMigrate(type: FlywayMigrateTask) {
url = testDbUrl
}