Class: Kamal::Commands::Builder

Inherits:
Base
  • Object
show all
Includes:
Clone
Defined in:
lib/kamal/commands/builder.rb

Defined Under Namespace

Modules: Clone Classes: Base, Hybrid, Local, Remote

Constant Summary

Constants inherited from Base

Kamal::Commands::Base::DOCKER_HEALTH_STATUS_FORMAT

Instance Attribute Summary

Attributes inherited from Base

#config

Instance Method Summary collapse

Methods included from Clone

#clone, #clone_reset_steps, #clone_revision, #clone_status, #escaped_build_directory, #escaped_root

Methods inherited from Base

#container_id_for, #initialize, #make_directory, #make_directory_for, #remove_directory, #remove_file, #run_over_ssh

Constructor Details

This class inherits a constructor from Kamal::Commands::Base

Instance Method Details

#ensure_local_dependencies_installedObject



38
39
40
41
42
43
44
45
46
# File 'lib/kamal/commands/builder.rb', line 38

def ensure_local_dependencies_installed
  if name.native?
    ensure_local_docker_installed
  else
    combine \
      ensure_local_docker_installed,
      ensure_local_buildx_installed
  end
end

#hybridObject



33
34
35
# File 'lib/kamal/commands/builder.rb', line 33

def hybrid
  @hybrid ||= Kamal::Commands::Builder::Hybrid.new(config)
end

#localObject



29
30
31
# File 'lib/kamal/commands/builder.rb', line 29

def local
  @local ||= Kamal::Commands::Builder::Local.new(config)
end

#nameObject



9
10
11
# File 'lib/kamal/commands/builder.rb', line 9

def name
  target.class.to_s.remove("Kamal::Commands::Builder::").underscore.inquiry
end

#remoteObject



25
26
27
# File 'lib/kamal/commands/builder.rb', line 25

def remote
  @remote ||= Kamal::Commands::Builder::Remote.new(config)
end

#targetObject



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/kamal/commands/builder.rb', line 13

def target
  if remote?
    if local?
      hybrid
    else
      remote
    end
  else
    local
  end
end