Skip to content

Commit

Permalink
Merge pull request #115 from jflo/fewerDockers
Browse files Browse the repository at this point in the history
more loop removal, stop updating existing tags
  • Loading branch information
jflo authored Apr 2, 2024
2 parents 7b09751 + 517369d commit 340b934
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -850,34 +850,23 @@ task dockerUploadRelease {

task manifestDocker {
def image = "${dockerImageName}:${dockerBuildVersion}"
def archs = ["arm64", "amd64"]
def tags = ["${image}"]

if (project.hasProperty('branch') && project.property('branch') == 'main') {
tags.add("${dockerImageName}:develop")
}

if (!isInterimBuild(dockerBuildVersion)) {
tags.add("${dockerImageName}:" + dockerBuildVersion.split(/\./)[0..1].join('.'))
}
def archs = ["arm64", "amd64"] //TODO: this assumes dockerUpload task has already been run on 2 different archs!

doLast {
for (baseTag in tags) {
exec {
targets = ""
archs.forEach { arch -> targets += "'${baseTag}-${arch}' " }
def cmd = "docker manifest create '${baseTag}' ${targets}"
def targets = ""
archs.forEach { arch -> targets += "'${image}-${arch}' " }
def cmd = "docker manifest create '${image}' ${targets}"
println "Executing '${cmd}'"
executable shell
args "-c", cmd
}
exec {
def cmd = "docker manifest push '${baseTag}'"
def cmd = "docker manifest push '${image}'"
println "Executing '${cmd}'"
executable shell
args "-c", cmd
}
}
}
}

Expand Down

0 comments on commit 340b934

Please sign in to comment.