Changes method for multi-destination build

This commit is contained in:
Hyatt 2022-03-29 09:43:47 -05:00
parent cbf0472b90
commit d9bed23d6b
Signed by: nhyatt
GPG Key ID: C50D0BBB5BC40BEA

View File

@ -132,7 +132,6 @@ def buildContainerMultipleDestinations (Map config, List buildArg = []) {
container ("kaniko") {
writeFile (file: ws + "/Dockerfile", text: config.dockerFile)
def buildArguments = ""
def repoAuth = ["auths": [:]]
for (i in config.repositoryAccess) {
withCredentials([usernameColonPassword(
@ -141,10 +140,14 @@ def buildContainerMultipleDestinations (Map config, List buildArg = []) {
)]) {
repoAuth."auths"[i.repository] = ["auth": dCreds.bytes.encodeBase64().toString()]
}
buildArguments += " --destination \"${i.repository}${i.destination}\""
}
sh "set +x; printf '${JsonOutput.toJson(repoAuth)}' > /kaniko/.docker/config.json"
def buildArguments = ""
for (i in config.destination) {
buildArguments += " --destination \"${i}\""
}
for (i in buildArg) {
buildArguments += " --build-arg ${i}"
}