ENT-6426: update docker tahhing inline with our policies

old
corda/corda-zulu-java1.8-4.8.5:latest

new
corda/corda:4.8.5-zulu-openjdk8

based on pattern
{repo}:{version}-{base-Image}

Remove some redundant code
This commit is contained in:
Ronan Browne 2022-01-16 17:01:23 +00:00
parent 4362ef6637
commit ccbfb0462c

View File

@ -33,25 +33,25 @@ shadowJar {
}
enum ImageVariant {
UBUNTU_ZULU("zulu", "Dockerfile", "1.8"),
UBUNTU_ZULU_11("zulu", "Dockerfile11", "11"),
AL_CORRETTO("corretto", "DockerfileAL", "1.8"),
UBUNTU_ZULU("Dockerfile", "1.8", "zulu-openjdk8"),
UBUNTU_ZULU_11("Dockerfile11", "11", "zulu-openjdk11"),
AL_CORRETTO("DockerfileAL", "1.8", "amazonlinux2"),
OFFICIAL(UBUNTU_ZULU)
String knownAs
String dockerFile
String javaVersion
String baseImgaeFullName
ImageVariant(ImageVariant other) {
this.knownAs = other.knownAs
this.dockerFile = other.dockerFile
this.javaVersion = other.javaVersion
this.baseImgaeFullName = other.baseImgaeFullName
}
ImageVariant(String knownAs, String dockerFile, String javaVersion) {
this.knownAs = knownAs
ImageVariant(String dockerFile, String javaVersion, String baseImgaeFullName) {
this.dockerFile = dockerFile
this.javaVersion = javaVersion
this.baseImgaeFullName = baseImgaeFullName
}
static final String getRepository(Project project) {
@ -59,7 +59,7 @@ enum ImageVariant {
}
Set<Identifier> buildTags(Project project) {
return ["${project.version.toString().toLowerCase()}-${knownAs}-${javaVersion}"].stream().map {
return ["${project.version.toString().toLowerCase()}-${baseImgaeFullName}"].stream().map {
toAppend -> "${getRepository(project)}:${toAppend}".toString()
}.map(Identifier.&fromCompoundString).collect(Collectors.toSet())
}