Simplfy choosing a builder

This commit is contained in:
Donal McBreen
2024-06-06 12:53:08 +01:00
parent cf80932216
commit e7431f9832

View File

@@ -2,6 +2,7 @@ require "active_support/core_ext/string/filters"
class Kamal::Commands::Builder < Kamal::Commands::Base
delegate :create, :remove, :push, :clean, :pull, :info, :buildx_inspect, :validate_image, :first_mirror, to: :target
delegate :multiarch?, :local?, :remote?, to: "config.builder"
include Clone
@@ -10,15 +11,12 @@ class Kamal::Commands::Builder < Kamal::Commands::Base
end
def target
case
when !config.builder.multiarch? && !config.builder.cached?
local
when !config.builder.multiarch? && config.builder.cached?
local
when config.builder.local? && config.builder.remote?
if remote?
if local?
hybrid
when config.builder.remote?
else
remote
end
else
local
end