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 class Kamal::Commands::Builder < Kamal::Commands::Base
delegate :create, :remove, :push, :clean, :pull, :info, :buildx_inspect, :validate_image, :first_mirror, to: :target delegate :create, :remove, :push, :clean, :pull, :info, :buildx_inspect, :validate_image, :first_mirror, to: :target
delegate :multiarch?, :local?, :remote?, to: "config.builder"
include Clone include Clone
@@ -10,15 +11,12 @@ class Kamal::Commands::Builder < Kamal::Commands::Base
end end
def target def target
case if remote?
when !config.builder.multiarch? && !config.builder.cached? if local?
local hybrid
when !config.builder.multiarch? && config.builder.cached? else
local remote
when config.builder.local? && config.builder.remote? end
hybrid
when config.builder.remote?
remote
else else
local local
end end