-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle.kts
69 lines (57 loc) · 2.15 KB
/
build.gradle.kts
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
import org.gradle.api.tasks.wrapper.Wrapper.DistributionType.ALL
plugins {
kotlin("jvm") version("2.0.0")
id("org.graalvm.buildtools.native") version("0.10.2")
}
val hexagonVersion = "3.6.0"
val hexagonExtraVersion = "3.6.0"
val logbackVersion = "1.5.6"
val testcontainersVersion = "1.19.8"
val gradleScripts = "https://raw.githubusercontent.com/hexagontk/hexagon/$hexagonVersion/gradle"
ext.set("modules", "java.xml,java.naming")
ext.set("options", "-Xms32M -Xmx128m -XX:+UseNUMA")
ext.set("applicationClass", "com.hexagontk.todo.backend.MainKt")
apply(from = "$gradleScripts/kotlin.gradle")
apply(from = "$gradleScripts/application.gradle")
dependencies {
implementation("com.hexagonkt:http_server_jetty:$hexagonVersion")
implementation("com.hexagonkt:serialization_jackson_json:$hexagonVersion")
implementation("com.hexagonkt:rest:$hexagonVersion")
implementation("com.hexagonkt.extra:store_mongodb:$hexagonExtraVersion")
implementation("ch.qos.logback:logback-classic:$logbackVersion")
testImplementation("com.hexagonkt:http_client_jetty:$hexagonVersion")
testImplementation("com.hexagonkt:rest_tools:$hexagonVersion") {
exclude(module = "commons-codec")
}
testImplementation("org.testcontainers:mongodb:$testcontainersVersion") {
exclude(module = "commons-compress")
}
}
tasks.wrapper {
gradleVersion = "8.8"
distributionType = ALL
}
tasks.register("buildImage", type = Exec::class) {
dependsOn("jpackage")
commandLine("docker", "compose", "--profile", "local", "build")
dockerEnvironment()
}
tasks.register("push", type = Exec::class) {
dependsOn("buildImage")
commandLine("docker", "compose", "--profile", "local", "push")
dockerEnvironment()
}
tasks.register("up", type = Exec::class) {
dependsOn("push")
commandLine("docker", "compose", "--profile", "local", "up", "-d")
dockerEnvironment()
}
tasks.register("rm", type = Exec::class) {
commandLine("docker", "compose", "--profile", "local", "rm", "-sfv")
}
fun Exec.dockerEnvironment() {
environment(
"REGISTRY" to (environment["REGISTRY"] ?: "k3d.localhost:5000/"),
"VERSION" to version
)
}