Files
kamal/lib/kamal/commands/builder.rb
Mike Dalessio 2127f1708a feat: Introduce a build dev command
which will build a "dirty" image using the working directory.

This command is different from `build push` in two important ways:

- the image tags will have a suffix of `-dirty`
- the export action is "docker", pushing to the local docker image store

The command also supports the `--output` option just added to `build
push` to override that default.

This command is intended to allow developers to quickly iterate on a
docker image built from their local working directory while avoiding
any confusion with a pristine image built from a git clone, and
keeping those images on the local dev system by default.
2025-01-20 18:52:21 -05:00

43 lines
886 B
Ruby

require "active_support/core_ext/string/filters"
class Kamal::Commands::Builder < Kamal::Commands::Base
delegate :create, :remove, :dev, :push, :clean, :pull, :info, :inspect_builder, :validate_image, :first_mirror, to: :target
delegate :local?, :remote?, :cloud?, to: "config.builder"
include Clone
def name
target.class.to_s.remove("Kamal::Commands::Builder::").underscore.inquiry
end
def target
if remote?
if local?
hybrid
else
remote
end
elsif cloud?
cloud
else
local
end
end
def remote
@remote ||= Kamal::Commands::Builder::Remote.new(config)
end
def local
@local ||= Kamal::Commands::Builder::Local.new(config)
end
def hybrid
@hybrid ||= Kamal::Commands::Builder::Hybrid.new(config)
end
def cloud
@cloud ||= Kamal::Commands::Builder::Cloud.new(config)
end
end