finish dependency update, also use the newer docker file template haha
All checks were successful
Build & Publish / build (push) Successful in 13m6s
All checks were successful
Build & Publish / build (push) Successful in 13m6s
This commit is contained in:
parent
6fa42168ac
commit
bf93c329b7
3 changed files with 62 additions and 22 deletions
2
.idea/kotlinc.xml
generated
2
.idea/kotlinc.xml
generated
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="KotlinJpsPluginSettings">
|
||||
<option name="version" value="2.1.0" />
|
||||
<option name="version" value="2.1.21" />
|
||||
</component>
|
||||
</project>
|
|
@ -2,17 +2,17 @@ import dev.kordex.gradle.plugins.docker.file.*
|
|||
import dev.kordex.gradle.plugins.kordex.DataCollection
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
kotlin("plugin.serialization")
|
||||
distribution
|
||||
|
||||
id("com.github.johnrengelman.shadow")
|
||||
alias(libs.plugins.kotlin.jvm)
|
||||
alias(libs.plugins.kotlin.serialization)
|
||||
|
||||
id("dev.kordex.gradle.docker")
|
||||
id("dev.kordex.gradle.kordex")
|
||||
alias(libs.plugins.kordex.plugin)
|
||||
alias(libs.plugins.kordex.docker)
|
||||
}
|
||||
|
||||
group = "dev.jansel"
|
||||
version = "1.1-SNAPSHOT"
|
||||
version = "1.2-SNAPSHOT"
|
||||
|
||||
dependencies {
|
||||
|
||||
|
@ -31,9 +31,26 @@ dependencies {
|
|||
implementation(libs.logging)
|
||||
}
|
||||
|
||||
// Configure distributions plugin
|
||||
distributions {
|
||||
main {
|
||||
distributionBaseName = project.name
|
||||
|
||||
contents {
|
||||
// Copy the LICENSE file into the distribution
|
||||
from("LICENSE")
|
||||
|
||||
// Exclude src/main/dist/README.md
|
||||
exclude("README.md")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
kordEx {
|
||||
kordExVersion = "2.3.1-SNAPSHOT"
|
||||
jvmTarget = 21
|
||||
ignoreIncompatibleKotlinVersion = true
|
||||
|
||||
bot {
|
||||
// See https://docs.kordex.dev/data-collection.html
|
||||
|
@ -58,37 +75,51 @@ docker {
|
|||
// Each function (aside from comment/emptyLine) corresponds to a Dockerfile instruction.
|
||||
// See: https://docs.docker.com/reference/dockerfile/
|
||||
|
||||
from("azul/zulu-openjdk-alpine:21-jre-headless-latest")
|
||||
from("openjdk:21-jdk-slim")
|
||||
|
||||
emptyLine()
|
||||
|
||||
comment("Create required directories")
|
||||
runShell("mkdir -p /bot/plugins")
|
||||
runShell("mkdir -p /bot/data")
|
||||
|
||||
emptyLine()
|
||||
|
||||
copy("build/libs/$name-*-all.jar", "/bot/bot.jar")
|
||||
runShell("mkdir -p /dist/out")
|
||||
|
||||
emptyLine()
|
||||
|
||||
// Add volumes for locations that you need to persist. This is important!
|
||||
comment("Declare required volumes")
|
||||
volume("/bot/data") // Storage for data files
|
||||
volume("/bot/plugins") // Plugin ZIP/JAR location
|
||||
|
||||
emptyLine()
|
||||
|
||||
comment("Copy the distribution files into the container")
|
||||
copy("build/distributions/${project.name}-${project.version}.tar", "/dist")
|
||||
|
||||
emptyLine()
|
||||
|
||||
comment("Extract the distribution files, and prepare them for use")
|
||||
runShell("tar -xf /dist/${project.name}-${project.version}.tar -C /dist/out")
|
||||
|
||||
if (file("src/main/dist/plugins").isDirectory) {
|
||||
runShell("mv /dist/out/${project.name}-${project.version}/plugins/* /bot/plugins")
|
||||
}
|
||||
|
||||
runShell("chmod +x /dist/out/${project.name}-${project.version}/bin/$name")
|
||||
|
||||
emptyLine()
|
||||
|
||||
comment("Clean up unnecessary files")
|
||||
runShell("rm /dist/${project.name}-${project.version}.tar")
|
||||
|
||||
emptyLine()
|
||||
|
||||
comment("Set the correct working directory")
|
||||
workdir("/bot")
|
||||
|
||||
emptyLine()
|
||||
|
||||
entryPointExec(
|
||||
"java", "-Xmx2G",
|
||||
"-jar", "/bot/bot.jar"
|
||||
)
|
||||
comment("Run the distribution start script")
|
||||
entryPointExec("/dist/out/${project.name}-${project.version}/bin/$name")
|
||||
}
|
||||
}
|
||||
|
||||
tasks.wrapper {
|
||||
gradleVersion = "8.14.2"
|
||||
distributionType = Wrapper.DistributionType.BIN
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[versions]
|
||||
kotlin = "2.1.0" # Note: Plugin versions must be updated in the settings.gradle.kts too
|
||||
kotlin = "2.1.21" # Note: Plugin versions must be updated in the settings.gradle.kts too
|
||||
|
||||
groovy = "3.0.25"
|
||||
jansi = "2.4.2"
|
||||
|
@ -11,6 +11,7 @@ twitch4j = "1.25.0"
|
|||
events4j = "0.12.2"
|
||||
kx-coroutines = "1.10.2"
|
||||
kmongo = "5.2.1"
|
||||
kordex-gradle = "1.7.1"
|
||||
|
||||
[libraries]
|
||||
groovy = { module = "org.codehaus.groovy:groovy", version.ref = "groovy" }
|
||||
|
@ -24,3 +25,11 @@ logging = { module = "io.github.oshai:kotlin-logging", version.ref = "logging" }
|
|||
twitch4j = { module = "com.github.twitch4j:twitch4j", version.ref = "twitch4j" }
|
||||
events4j = { module = "com.github.philippheuer.events4j:events4j-handler-reactor", version.ref = "events4j" }
|
||||
kmongo = { module="org.litote.kmongo:kmongo-coroutine-serialization", version.ref = "kmongo" }
|
||||
|
||||
|
||||
[plugins]
|
||||
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
|
||||
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
|
||||
|
||||
kordex-docker = { id = "dev.kordex.gradle.docker", version.ref = "kordex-gradle" }
|
||||
kordex-plugin = { id = "dev.kordex.gradle.kordex", version.ref = "kordex-gradle" }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue