Simplfy choosing a builder
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user