Class: KuberKit::Core::Image

Inherits:
Object
  • Object
show all
Defined in:
lib/kuber_kit/core/image.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, dependencies:, registry:, dockerfile_path:, build_vars:, build_context_dir:, tag:, before_build_callback:, after_build_callback:) ⇒ Image

Returns a new instance of Image.



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/kuber_kit/core/image.rb', line 16

def initialize(name:, dependencies:, registry:, dockerfile_path:, build_vars:, build_context_dir:, tag:, before_build_callback:, after_build_callback:)
  @name = name
  @dependencies = dependencies
  @registry = registry
  @dockerfile_path = dockerfile_path
  @build_vars = build_vars
  @build_context_dir = build_context_dir
  @tag = tag
  @before_build_callback = before_build_callback
  @after_build_callback = after_build_callback
end

Instance Attribute Details

#after_build_callbackObject (readonly)

Returns the value of attribute after_build_callback.



2
3
4
# File 'lib/kuber_kit/core/image.rb', line 2

def after_build_callback
  @after_build_callback
end

#before_build_callbackObject (readonly)

Returns the value of attribute before_build_callback.



2
3
4
# File 'lib/kuber_kit/core/image.rb', line 2

def before_build_callback
  @before_build_callback
end

#build_context_dirObject (readonly)

Returns the value of attribute build_context_dir.



2
3
4
# File 'lib/kuber_kit/core/image.rb', line 2

def build_context_dir
  @build_context_dir
end

#build_varsObject (readonly)

Returns the value of attribute build_vars.



2
3
4
# File 'lib/kuber_kit/core/image.rb', line 2

def build_vars
  @build_vars
end

#dependenciesObject (readonly)

Returns the value of attribute dependencies.



2
3
4
# File 'lib/kuber_kit/core/image.rb', line 2

def dependencies
  @dependencies
end

#dockerfile_pathObject (readonly)

Returns the value of attribute dockerfile_path.



2
3
4
# File 'lib/kuber_kit/core/image.rb', line 2

def dockerfile_path
  @dockerfile_path
end

#nameObject (readonly)

Returns the value of attribute name.



2
3
4
# File 'lib/kuber_kit/core/image.rb', line 2

def name
  @name
end

#registryObject (readonly)

Returns the value of attribute registry.



2
3
4
# File 'lib/kuber_kit/core/image.rb', line 2

def registry
  @registry
end

#tagObject (readonly)

Returns the value of attribute tag.



2
3
4
# File 'lib/kuber_kit/core/image.rb', line 2

def tag
  @tag
end

Instance Method Details

#build_argsObject



36
37
38
39
40
41
# File 'lib/kuber_kit/core/image.rb', line 36

def build_args
  unless KuberKit.deprecation_warnings_disabled?
    puts "WARNING: build_args is deprecated, please use build_vars instead"
  end
  build_vars
end

#registry_urlObject



28
29
30
# File 'lib/kuber_kit/core/image.rb', line 28

def registry_url
  "#{registry.path}/#{name}:#{tag}"
end

#remote_registry_urlObject



32
33
34
# File 'lib/kuber_kit/core/image.rb', line 32

def remote_registry_url
  "#{registry.remote_path}/#{name}:#{tag}"
end