Class: Specinfra::Backend::Dockerfile
- Inherits:
-
Base
- Object
- Base
- Specinfra::Backend::Dockerfile
show all
- Defined in:
- lib/specinfra/backend/dockerfile.rb
Instance Method Summary
collapse
Methods inherited from Base
clear, #command, #get_config, #host_inventory, instance, #os_info, #set_config, #set_example, #stderr_handler=, #stdout_handler=
Constructor Details
Returns a new instance of Dockerfile.
[View source]
4
5
6
7
8
9
10
11
12
13
14
15
|
# File 'lib/specinfra/backend/dockerfile.rb', line 4
def initialize(config = {})
super
@lines = []
ObjectSpace.define_finalizer(self) {
if get_config(:dockerfile_finalizer).nil?
puts @lines
else
get_config(:dockerfile_finalizer).call(@lines)
end
}
end
|
Instance Method Details
permalink
#from(base) ⇒ Object
[View source]
27
28
29
|
# File 'lib/specinfra/backend/dockerfile.rb', line 27
def from(base)
@lines << "FROM #{base}"
end
|
permalink
#run_command(cmd, opts = {}) ⇒ Object
[View source]
17
18
19
20
|
# File 'lib/specinfra/backend/dockerfile.rb', line 17
def run_command(cmd, opts={})
@lines << "RUN #{cmd}"
CommandResult.new
end
|
permalink
#send_file(from, to) ⇒ Object
[View source]
22
23
24
25
|
# File 'lib/specinfra/backend/dockerfile.rb', line 22
def send_file(from, to)
@lines << "ADD #{from} #{to}"
CommandResult.new
end
|