-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
86 lines (67 loc) · 2.63 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
plugins {
id("com.github.johnrengelman.shadow") version "7.1.2"
id("io.micronaut.crac") version "3.7.7"
id("io.micronaut.application") version "3.7.7"
}
version = "0.1"
group = "io.github.rjaros87"
repositories {
mavenCentral()
maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
annotationProcessor("org.projectlombok:lombok")
annotationProcessor("io.micronaut:micronaut-http-validation")
implementation("io.micronaut:micronaut-http-client")
implementation("io.micronaut:micronaut-jackson-databind")
implementation("io.micronaut.crac:micronaut-crac")
implementation("io.micronaut.reactor:micronaut-reactor")
implementation("io.micronaut.reactor:micronaut-reactor-http-client")
implementation("io.micronaut.redis:micronaut-redis-lettuce")
implementation("jakarta.annotation:jakarta.annotation-api")
compileOnly("org.projectlombok:lombok")
runtimeOnly("ch.qos.logback:logback-classic")
compileOnly("org.graalvm.nativeimage:svm")
implementation("io.micronaut:micronaut-validation")
}
application {
mainClass.set("io.github.rjaros87.Application")
}
tasks {
dockerBuild {
images = ["${System.env.DOCKER_IMAGE ?: "rjaros87/" + project.name + "-regular"}:$project.version"]
}
dockerBuildNative {
images = ["${System.env.DOCKER_IMAGE_GRAALVM ?: "rjaros87/" + project.name + "-graalvm"}:$project.version"]
}
dockerBuildCrac {
images = ["${System.env.DOCKER_IMAGE_CRAC ?: "rjaros87/" + project.name + "-crac"}:$project.version"]
}
}
java {
sourceCompatibility = JavaVersion.toVersion("17")
targetCompatibility = JavaVersion.toVersion("17")
}
graalvmNative.toolchainDetection = false
micronaut {
runtime("netty")
testRuntime("junit5")
processing {
incremental(true)
annotations("io.github.rjaros87.*")
}
crac {
// is the plugin enabled or not
enabled = true
network = "localinfrastrucutre_app-tier"
// the base docker image to use for the Checkpoint and final images
baseImage = "ubuntu:22.04"
// The platform to build the image for (currently must be linux/amd64)
platform = "linux/amd64"
// A command to run that will be successful when the application is ready to be checkpointed.
preCheckpointReadinessCommand = "curl --output /dev/null -XGET -sS 'http://localhost:8080/health'"
// You can use these to replace the script that generates a checkpoint, and the script that warms up the
// application prior to checkpointing
warmupScript = file("customWarmupScript.sh")
}
}