-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
55 lines (46 loc) · 1.62 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
49
50
51
52
53
54
55
import org.flywaydb.gradle.task.FlywayMigrateTask
plugins {
id 'org.springframework.boot' version '2.4.0'
id 'io.spring.dependency-management' version '1.0.10.RELEASE'
id "org.flywaydb.flyway" version "7.3.0"
id 'java'
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-jdbc'
implementation 'mysql:mysql-connector-java'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
test {
useJUnitPlatform()
}
def developmentDbUrl = "jdbc:mysql://localhost:3306/tracker_dev?user=tracker&useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false"
bootRun.environment([
"WELCOME_MESSAGE": "howdy",
"SPRING_DATASOURCE_URL": developmentDbUrl,
"MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE": "*",
"MANAGEMENT_ENDPOINT_HEALTH_SHOWDETAILS": "always",
"MANAGEMENT_HEALTH_PROBES_ENABLED": true,
])
def testDbUrl = "jdbc:mysql://localhost:3306/tracker_test?user=tracker&useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false"
test.environment([
"WELCOME_MESSAGE": "Hello from test",
"SPRING_DATASOURCE_URL": testDbUrl,
"MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE": "*",
])
flyway {
url = developmentDbUrl
user = "tracker"
password = ""
locations = ["filesystem:databases/tracker/migrations"]
}
task testMigrate(type: FlywayMigrateTask) {
url = testDbUrl
}
springBoot {
buildInfo()
}