initial commit

This commit is contained in:
2025-03-04 15:35:36 +03:00
commit 7f3a76c984
28 changed files with 1385 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
package util
import groovy.transform.CompileStatic
@CompileStatic
class DockerImageNames {
static String getImageTag(String baseName, String dockerfile) {
def imageTagPostfix = CIProperties.findProperty("docker.image.tag.${dockerfile.toLowerCase()}.postfix").orElse("")
return "${baseName}${imageTagPostfix}"
}
static String getImageName(String dockerfileName) {
def propertyNames = [
"docker.image.${dockerfileName.toLowerCase()}.name",
"docker.image.base.name"
]
return propertyNames.stream()
.map { it.toString() }
.map {
CIProperties.findProperty(it).orNull()
}
.filter { it != null }
.findFirst()
.orElseThrow { new NoSuchElementException("There is no one property set: ${propertyNames}") }
}
}