Skip to content

Commit

Permalink
buildbinary: support comma-separated list of base repositories (#1363)
Browse files Browse the repository at this point in the history
  • Loading branch information
edganiukov authored Dec 30, 2024
1 parent bde49a3 commit a8b484b
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions internal/cli/cmd/buildbinary.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,20 +143,22 @@ func buildLocations(ctx context.Context, env cfg.Context, reg registry.Manager,

for _, image := range resolvables {
var repository compute.Computable[oci.RepositoryWithParent]
if baseRepository != "" {
repository = registry.StaticRepository(nil, filepath.Join(baseRepository, pkg.PackageName().String()), oci.RegistryAccess{})
} else {
repository = reg.AllocateName(pkg.PackageName().String(), userTag)
for _, bp := range strings.Split(baseRepository, ",") {
if bp != "" {
repository = registry.StaticRepository(nil, filepath.Join(bp, pkg.PackageName().String()), oci.RegistryAccess{})
} else {
repository = reg.AllocateName(pkg.PackageName().String(), userTag)
}

var img compute.Computable[oci.ImageID]
if opts.publishToDocker {
img = docker.PublishImage(repository, image)
} else {
img = oci.PublishResolvable(repository, image, nil)
}

images = append(images, fromImage(pkg.PackageName(), img))
}

var img compute.Computable[oci.ImageID]
if opts.publishToDocker {
img = docker.PublishImage(repository, image)
} else {
img = oci.PublishResolvable(repository, image, nil)
}

images = append(images, fromImage(pkg.PackageName(), img))
}
}

Expand Down

0 comments on commit a8b484b

Please sign in to comment.