-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
66 lines (49 loc) · 1.84 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
56
57
58
59
60
61
62
63
64
65
66
plugins {
id 'org.springframework.boot' version '2.1.3.RELEASE'
id 'java'
id 'org.jetbrains.kotlin.jvm' version '1.3.21'
id 'org.jetbrains.kotlin.plugin.spring' version '1.3.21'
}
apply plugin: 'io.spring.dependency-management'
group = 'com.github.fitzoh'
sourceCompatibility = '1.8'
repositories {
mavenCentral()
}
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'io.micrometer:micrometer-registry-prometheus'
//JSON logging dependencies
implementation 'net.logstash.logback:logstash-logback-encoder:5.3'
implementation 'ch.qos.logback:logback-classic:1.2.3'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
String prometheusContainer = "prometheus"
task startPrometheus(type: Exec) {
String prometheusConfig = project.file('prometheus.yml').absolutePath
commandLine "docker", "run", "-d", "-p", "9090:9090", "-v", "$prometheusConfig:/etc/prometheus/prometheus.yml", "--name", prometheusContainer, "--rm", "prom/prometheus"
}
task stopPrometheusPrometheus(type: Exec) {
commandLine "docker", "kill", prometheusContainer
}
String grafanaContainer = "grafana"
task startGrafana(type: Exec) {
String grafanaDataVolume = project.file("grafana/data")
commandLine "docker", "run", "-d", "-p", "3000:3000", "-v", "$grafanaDataVolume:/var/lib/grafana","--name", grafanaContainer, "--rm", "grafana/grafana"
}
task stopGrafana(type: Exec) {
commandLine "docker", "kill", grafanaContainer
}