Changes method for multi-destination build
This commit is contained in:
parent
cbf0472b90
commit
d9bed23d6b
@ -132,7 +132,6 @@ def buildContainerMultipleDestinations (Map config, List buildArg = []) {
|
|||||||
container ("kaniko") {
|
container ("kaniko") {
|
||||||
writeFile (file: ws + "/Dockerfile", text: config.dockerFile)
|
writeFile (file: ws + "/Dockerfile", text: config.dockerFile)
|
||||||
|
|
||||||
def buildArguments = ""
|
|
||||||
def repoAuth = ["auths": [:]]
|
def repoAuth = ["auths": [:]]
|
||||||
for (i in config.repositoryAccess) {
|
for (i in config.repositoryAccess) {
|
||||||
withCredentials([usernameColonPassword(
|
withCredentials([usernameColonPassword(
|
||||||
@ -141,10 +140,14 @@ def buildContainerMultipleDestinations (Map config, List buildArg = []) {
|
|||||||
)]) {
|
)]) {
|
||||||
repoAuth."auths"[i.repository] = ["auth": dCreds.bytes.encodeBase64().toString()]
|
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"
|
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) {
|
for (i in buildArg) {
|
||||||
buildArguments += " --build-arg ${i}"
|
buildArguments += " --build-arg ${i}"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user