From 958cb05f205035c8738d6bc7a8aed472c70f4386 Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Fri, 22 Nov 2024 12:07:31 +0100 Subject: [PATCH] Add oci image definition --- build.gradle.kts | 32 ++++++++++++++++++++++++++++++++ gradle/libs.versions.toml | 1 + 2 files changed, 33 insertions(+) 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" }