Class: Hippo::BuildSpec

Inherits:
Object
  • Object
show all
Defined in:
lib/hippo/build_spec.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(recipe, name, options) ⇒ BuildSpec

Returns a new instance of BuildSpec.



7
8
9
10
11
# File 'lib/hippo/build_spec.rb', line 7

def initialize(recipe, name, options)
  @recipe = recipe
  @name = name
  @options = options
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/hippo/build_spec.rb', line 5

def name
  @name
end

Instance Method Details

#dockerfileObject



13
14
15
# File 'lib/hippo/build_spec.rb', line 13

def dockerfile
  @options['dockerfile'] || 'Dockerfile'
end

#image_nameObject



17
18
19
# File 'lib/hippo/build_spec.rb', line 17

def image_name
  @options['image-name']
end

#image_name_for_commit(commit_ref) ⇒ Object



21
22
23
# File 'lib/hippo/build_spec.rb', line 21

def image_name_for_commit(commit_ref)
  "#{image_name}:#{commit_ref}"
end

#template_varsObject



25
26
27
28
29
30
# File 'lib/hippo/build_spec.rb', line 25

def template_vars
  {
    'dockerfile' => dockerfile,
    'image-name' => image_name
  }
end