Class: KuberKit::Core::ContextHelper::BaseHelper
- Inherits:
-
Object
- Object
- KuberKit::Core::ContextHelper::BaseHelper
show all
- Defined in:
- lib/kuber_kit/core/context_helper/base_helper.rb
Constant Summary
collapse
- CONTRACT =
RespondTo[:get_binding]
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(image_store:, artifact_store:, shell:, env_file_reader:) ⇒ BaseHelper
Returns a new instance of BaseHelper.
6
7
8
9
10
11
|
# 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
|
Instance Attribute Details
#artifact_store ⇒ Object
Returns the value of attribute artifact_store.
4
5
6
|
# File 'lib/kuber_kit/core/context_helper/base_helper.rb', line 4
def artifact_store
@artifact_store
end
|
#env_file_reader ⇒ Object
Returns the value of attribute env_file_reader.
4
5
6
|
# File 'lib/kuber_kit/core/context_helper/base_helper.rb', line 4
def env_file_reader
@env_file_reader
end
|
#image_store ⇒ Object
Returns the value of attribute image_store.
4
5
6
|
# File 'lib/kuber_kit/core/context_helper/base_helper.rb', line 4
def image_store
@image_store
end
|
Returns the value of attribute shell.
4
5
6
|
# File 'lib/kuber_kit/core/context_helper/base_helper.rb', line 4
def shell
@shell
end
|
Instance Method Details
#artifact_path(name, file_name = nil) ⇒ Object
19
20
21
22
|
# 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
|
#env_file(env_file_name) ⇒ Object
24
25
26
|
# 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 ⇒ Object
43
44
45
|
# File 'lib/kuber_kit/core/context_helper/base_helper.rb', line 43
def get_binding
binding
end
|
#global_build_args ⇒ Object
36
37
38
39
40
41
|
# 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 ⇒ Object
32
33
34
|
# 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) ⇒ Object
13
14
15
16
17
|
# 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
|