Sha256: 89e58673a91a940bdcba833f4ed2433c086f0130bf1b16f375e55ba92caf091f

Contents?: true

Size: 950 Bytes

Versions: 29

Compression:

Stored size: 950 Bytes

Contents

class KuberKit::ImageCompiler::ImageBuilder
  include KuberKit::Import[
    "shell.docker_commands",
    "image_compiler.version_tag_builder"
  ]

  Contract KuberKit::Shell::AbstractShell, KuberKit::Core::Image, String, KeywordArgs[
    context_helper: Maybe[KuberKit::Core::ContextHelper::BaseHelper::CONTRACT]
  ] => Any
  def build(shell, image, build_dir, context_helper: nil)
    image.before_build_callback.call(context_helper, build_dir) if image.before_build_callback

    docker_commands.build(shell, build_dir, ["-t=#{image.registry_url}"])

    version_tag = version_tag_builder.get_version
    docker_commands.tag(shell, image.registry_url, version_tag)

    if image.registry.remote?
      docker_commands.tag(shell, image.registry_url, image.remote_registry_url)
      docker_commands.push(shell, image.remote_registry_url)
    end

    image.after_build_callback.call(context_helper, build_dir) if image.after_build_callback
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
kuber_kit-0.2.1 lib/kuber_kit/image_compiler/image_builder.rb
kuber_kit-0.2.0 lib/kuber_kit/image_compiler/image_builder.rb
kuber_kit-0.1.9 lib/kuber_kit/image_compiler/image_builder.rb
kuber_kit-0.1.8 lib/kuber_kit/image_compiler/image_builder.rb
kuber_kit-0.1.7 lib/kuber_kit/image_compiler/image_builder.rb
kuber_kit-0.1.6 lib/kuber_kit/image_compiler/image_builder.rb
kuber_kit-0.1.5 lib/kuber_kit/image_compiler/image_builder.rb
kuber_kit-0.1.4 lib/kuber_kit/image_compiler/image_builder.rb
kuber_kit-0.1.3 lib/kuber_kit/image_compiler/image_builder.rb