diff --git a/build.gradle.kts b/build.gradle.kts index cd283f2..eff23c3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,7 @@ plugins { alias(libs.plugins.hivemq.extension) alias(libs.plugins.defaults) + alias(libs.plugins.oci) alias(libs.plugins.license) } @@ -24,6 +25,37 @@ dependencies { implementation(libs.commonsLang) } +oci { + registries { + dockerHub { + optionalCredentials() + } + } + imageMapping { + mapModule("com.hivemq", "hivemq-community-edition") { + toImage("hivemq/hivemq-ce") + } + } + imageDefinitions.register("main") { + allPlatforms { + dependencies { + runtime("com.hivemq:hivemq-community-edition:latest") { isChanging = true } + } + layers { + layer("hivemqExtension") { + contents { + permissions("opt/hivemq/", 0b111_111_000) + permissions("opt/hivemq/extensions/", 0b111_111_000) + into("opt/hivemq/extensions") { + from(zipTree(tasks.hivemqExtensionZip.flatMap { it.archiveFile })) + } + } + } + } + } + } +} + @Suppress("UnstableApiUsage") testing { suites { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b6e6462..93ba5cb 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -14,3 +14,4 @@ mockito = { module = "org.mockito:mockito-core", version.ref = "mockito" } defaults = { id = "io.github.sgtsilvio.gradle.defaults", version = "0.2.0" } hivemq-extension = { id = "com.hivemq.extension", version = "3.2.0" } license = { id = "com.github.hierynomus.license", version = "0.16.1" } +oci = { id = "io.github.sgtsilvio.gradle.oci", version = "0.16.0" }