@@ -267,17 +267,39 @@ lock(resource: "release-${params.STREAM}", extra: locks) {
267
267
credentialsId: 'oscontainer-push-registry-secret')]) {
268
268
def repos = registry_repos[configname]
269
269
def (artifact, metajsonname) = val
270
+ // XXX: remove this workaround when registy.ci.org supports multi-arch manifests
271
+ // push the manifest to the first repo in the list
272
+ def tag_args = repos[0].tags.collect{"--tag=$it"}
273
+ def v2s2_arg = repos[0].v2s2 ? "--v2s2" : ""
274
+ shwrap("""
275
+ export COSA_SUPERMIN_MEMORY=1024 # this really shouldn't require much RAM
276
+ cp \${REGISTRY_SECRET} tmp/push-secret-${metajsonname}
277
+ cosa supermin-run /usr/lib/coreos-assembler/cmd-push-container-manifest \
278
+ --auth=tmp/push-secret-${metajsonname} \
279
+ --repo=${repos[0].repo} ${tag_args.join(' ')} \
280
+ --artifact=${artifact} --metajsonname=${metajsonname} \
281
+ --build=${params.VERSION} ${v2s2_arg}
282
+ rm tmp/push-secret-${metajsonname}
283
+ """)
284
+
285
+ // for subsequent repos we use copy-container to copy the image
286
+ // from that first repo to the others because some registries (registry.ci.openshift.org)
287
+ // do not support multi-arch manifests.
288
+ // cosa copy-container have the magic to know this and push separate images
289
+ // with the arch as a tag suffix instead of a manifest.
290
+ def src_repo = repos[0].repo
291
+ def src_tag = repos[0].tags[0]
292
+ repos.remove(0)
270
293
for (repo in repos) {
271
- def tag_args = repo.tags.collect{"--tag=$it"}
272
- def v2s2_arg = repo.v2s2 ? "--v2s2" : ""
294
+ tag_args = repo.tags.collect{"--tag=$it"}
295
+ v2s2_arg = repo.v2s2 ? "--v2s2" : ""
273
296
shwrap("""
274
297
export COSA_SUPERMIN_MEMORY=1024 # this really shouldn't require much RAM
275
298
cp \${REGISTRY_SECRET} tmp/push-secret-${metajsonname}
276
- cosa supermin-run /usr/lib/coreos-assembler/cmd-push-container-manifest \
277
- --auth=tmp/push-secret-${metajsonname} \
278
- --repo=${repo.repo} ${tag_args.join(' ')} \
279
- --artifact=${artifact} --metajsonname=${metajsonname} \
280
- --build=${params.VERSION} ${v2s2_arg}
299
+ cosa supermin-run /usr/lib/coreos-assembler/cmd-copy-container \
300
+ --authfile=tmp/push-secret-${metajsonname} \
301
+ --tag ${src_tag} ${tag_args.join(' ')} ${v2s2_arg} \
302
+ ${src_repo} ${repo.repo}
281
303
rm tmp/push-secret-${metajsonname}
282
304
""")
283
305
}
0 commit comments