class KuberKit::Core::ContextHelper::BaseHelper

Constants

CONTRACT

Attributes

artifact_store[R]
env_file_reader[R]
image_store[R]
shell[R]

Public Class Methods

new(image_store:, artifact_store:, shell:, env_file_reader:) click to toggle source
# File lib/kuber_kit/core/context_helper/base_helper.rb, line 6
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

Public Instance Methods

artifact_path(name, file_name = nil) click to toggle source
# File lib/kuber_kit/core/context_helper/base_helper.rb, line 19
def artifact_path(name, file_name = nil)
  artifact = @artifact_store.get(name.to_sym)
  [artifact.cloned_path, file_name].compact.join("/")
end
configuration_name() click to toggle source
# File lib/kuber_kit/core/context_helper/base_helper.rb, line 28
def configuration_name
  KuberKit.current_configuration.name
end
env_file(env_file_name) click to toggle source
# File lib/kuber_kit/core/context_helper/base_helper.rb, line 24
def env_file(env_file_name)
  @env_file_reader.call(@shell, env_file_name)
end
get_binding() click to toggle source
# File lib/kuber_kit/core/context_helper/base_helper.rb, line 43
def get_binding
  binding
end
global_build_args() click to toggle source
# File lib/kuber_kit/core/context_helper/base_helper.rb, line 36
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
global_build_vars() click to toggle source
# File lib/kuber_kit/core/context_helper/base_helper.rb, line 32
def global_build_vars
  KuberKit.global_build_vars
end
image_url(image_name) click to toggle source
# File lib/kuber_kit/core/context_helper/base_helper.rb, line 13
def image_url(image_name)
  image = @image_store.get_image(image_name.to_sym)

  image.remote_registry_url
end