Skip to content

Commit

Permalink
Add oci image definition
Browse files Browse the repository at this point in the history
  • Loading branch information
SgtSilvio committed Nov 22, 2024
1 parent dd2de4c commit d325526
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
32 changes: 32 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
alias(libs.plugins.hivemq.extension)
alias(libs.plugins.defaults)
alias(libs.plugins.oci)
alias(libs.plugins.license)
}

Expand All @@ -23,6 +24,37 @@ dependencies {
compileOnly(libs.jetbrains.annotations)
}

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 }))
}
}
}
}
}
}
}

license {
header = rootDir.resolve("HEADER")
mapping("java", "SLASHSTAR_STYLE")
Expand Down
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ jetbrains-annotations = { module = "org.jetbrains:annotations", version.ref = "j
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" }

0 comments on commit d325526

Please sign in to comment.