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, Multiarch, Native

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

Methods inherited from Base

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

Constructor Details

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

Instance Method Details

#ensure_local_dependencies_installedObject



54
55
56
57
58
59
60
61
62
# File 'lib/kamal/commands/builder.rb', line 54

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

#multiarchObject



45
46
47
# File 'lib/kamal/commands/builder.rb', line 45

def multiarch
  @multiarch ||= Kamal::Commands::Builder::Multiarch.new(config)
end

#multiarch_remoteObject



49
50
51
# File 'lib/kamal/commands/builder.rb', line 49

def multiarch_remote
  @multiarch_remote ||= Kamal::Commands::Builder::Multiarch::Remote.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

#nativeObject



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

def native
  @native ||= Kamal::Commands::Builder::Native.new(config)
end

#native_cachedObject



37
38
39
# File 'lib/kamal/commands/builder.rb', line 37

def native_cached
  @native ||= Kamal::Commands::Builder::Native::Cached.new(config)
end

#native_remoteObject



41
42
43
# File 'lib/kamal/commands/builder.rb', line 41

def native_remote
  @native ||= Kamal::Commands::Builder::Native::Remote.new(config)
end

#targetObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/kamal/commands/builder.rb', line 13

def target
  if config.builder.multiarch?
    if config.builder.remote?
      if config.builder.local?
        multiarch_remote
      else
        native_remote
      end
    else
      multiarch
    end
  else
    if config.builder.cached?
      native_cached
    else
      native
    end
  end
end