Sha256: 4563dbaaee1f1a0cdc1e4e18f4fea1eac4f1b54dbc7cd8e5160913b15ea70bd1

Contents?: true

Size: 916 Bytes

Versions: 32

Compression:

Stored size: 916 Bytes

Contents

class KuberKit::ImageCompiler::ActionHandler
  include KuberKit::Import[
    "image_compiler.compiler",
    "core.image_store",
    "tools.build_dir_cleaner",
    "configs",
  ]

  Contract KuberKit::Shell::AbstractShell, Symbol, String => Any
  def call(shell, image_name, build_id)
    parent_dir = get_image_compile_parent_dir_for_shell(shell)

    image = image_store.get_image(image_name)

    build_dir_cleaner.call(shell, parent_dir: parent_dir)
    
    compile_dir = generate_compile_dir(parent_dir: parent_dir, build_id: build_id)

    compiler.compile(shell, image, compile_dir)
  end

  private
    def generate_compile_dir(parent_dir:, build_id:)
      File.join(parent_dir, build_id)
    end

    def get_image_compile_parent_dir_for_shell(shell)
      if shell.is_a?(KuberKit::Shell::SshShell)
        configs.remote_image_compile_dir
      else
        configs.image_compile_dir
      end
    end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
kuber_kit-1.3.9 lib/kuber_kit/image_compiler/action_handler.rb
kuber_kit-1.3.8 lib/kuber_kit/image_compiler/action_handler.rb
kuber_kit-1.3.7 lib/kuber_kit/image_compiler/action_handler.rb
kuber_kit-1.1.8 lib/kuber_kit/image_compiler/action_handler.rb
kuber_kit-1.3.6 lib/kuber_kit/image_compiler/action_handler.rb
kuber_kit-1.1.7 lib/kuber_kit/image_compiler/action_handler.rb
kuber_kit-1.3.5 lib/kuber_kit/image_compiler/action_handler.rb
kuber_kit-1.3.4 lib/kuber_kit/image_compiler/action_handler.rb
kuber_kit-1.1.6 lib/kuber_kit/image_compiler/action_handler.rb
kuber_kit-1.3.3 lib/kuber_kit/image_compiler/action_handler.rb
kuber_kit-1.3.2 lib/kuber_kit/image_compiler/action_handler.rb
kuber_kit-1.1.5 lib/kuber_kit/image_compiler/action_handler.rb
kuber_kit-1.3.1 lib/kuber_kit/image_compiler/action_handler.rb
kuber_kit-1.3.0 lib/kuber_kit/image_compiler/action_handler.rb
kuber_kit-1.1.4 lib/kuber_kit/image_compiler/action_handler.rb
kuber_kit-1.2.7 lib/kuber_kit/image_compiler/action_handler.rb
kuber_kit-1.2.6 lib/kuber_kit/image_compiler/action_handler.rb
kuber_kit-1.2.5 lib/kuber_kit/image_compiler/action_handler.rb
kuber_kit-1.2.4 lib/kuber_kit/image_compiler/action_handler.rb
kuber_kit-1.2.2 lib/kuber_kit/image_compiler/action_handler.rb