Sha256: db2c0462aa49ae6404f28a514dd67c70c0ac4399ca3d489b9051ba2f4c2887cc

Contents?: true

Size: 1.1 KB

Versions: 71

Compression:

Stored size: 1.1 KB

Contents

class KuberKit::Core::ContextHelper::BaseHelper
  CONTRACT = RespondTo[:get_binding]

  attr_reader :shell, :artifact_store, :image_store, :env_file_reader

  def initialize(image_store:, artifact_store:, shell:, env_file_reader:)
    @image_store      = image_store
    @artifact_store   = artifact_store
    @shell            = shell
    @env_file_reader  = env_file_reader
  end

  def image_url(image_name)
    image = @image_store.get_image(image_name.to_sym)

    image.remote_registry_url
  end

  def artifact_path(name, file_name = nil)
    artifact = @artifact_store.get(name.to_sym)
    [artifact.cloned_path, file_name].compact.join("/")
  end

  def env_file(env_file_name)
    @env_file_reader.call(@shell, env_file_name)
  end

  def configuration_name
    KuberKit.current_configuration.name
  end

  def global_build_vars
    KuberKit.global_build_vars
  end

  def global_build_args
    unless KuberKit.deprecation_warnings_disabled?
      puts "DEPRECATION: global_build_args is deprecated, please use global_build_vars instead"
    end
    global_build_vars
  end

  def get_binding
    binding
  end
end

Version data entries

71 entries across 71 versions & 1 rubygems

Version Path
kuber_kit-1.3.2 lib/kuber_kit/core/context_helper/base_helper.rb
kuber_kit-1.1.5 lib/kuber_kit/core/context_helper/base_helper.rb
kuber_kit-1.3.1 lib/kuber_kit/core/context_helper/base_helper.rb
kuber_kit-1.3.0 lib/kuber_kit/core/context_helper/base_helper.rb
kuber_kit-1.1.4 lib/kuber_kit/core/context_helper/base_helper.rb
kuber_kit-1.2.7 lib/kuber_kit/core/context_helper/base_helper.rb
kuber_kit-1.2.6 lib/kuber_kit/core/context_helper/base_helper.rb
kuber_kit-1.2.5 lib/kuber_kit/core/context_helper/base_helper.rb
kuber_kit-1.2.4 lib/kuber_kit/core/context_helper/base_helper.rb
kuber_kit-1.2.2 lib/kuber_kit/core/context_helper/base_helper.rb
kuber_kit-1.1.2 lib/kuber_kit/core/context_helper/base_helper.rb
kuber_kit-1.2.1 lib/kuber_kit/core/context_helper/base_helper.rb
kuber_kit-1.2.0 lib/kuber_kit/core/context_helper/base_helper.rb
kuber_kit-1.1.1 lib/kuber_kit/core/context_helper/base_helper.rb
kuber_kit-1.0.1 lib/kuber_kit/core/context_helper/base_helper.rb
kuber_kit-1.0.0 lib/kuber_kit/core/context_helper/base_helper.rb
kuber_kit-0.9.9 lib/kuber_kit/core/context_helper/base_helper.rb
kuber_kit-0.9.8 lib/kuber_kit/core/context_helper/base_helper.rb
kuber_kit-0.9.7 lib/kuber_kit/core/context_helper/base_helper.rb
kuber_kit-0.9.6 lib/kuber_kit/core/context_helper/base_helper.rb