Class: Deck::Container::Archive
Instance Method Summary
collapse
Methods included from Repeatable
#attributes, #next, #step
Methods included from Submodule
#attributes, #get, included, #map, #set, #value
Instance Method Details
#build_command(deps) ⇒ Object
20
21
22
23
|
# File 'lib/deck/container/archive.rb', line 20
def build_command(deps)
cmd = "ADD #{attributes[:file]} #{attributes[:path]}\n"
cmd += "RUN #{send attributes[:type]}"
end
|
#define(file, path: '/', type: :tar) ⇒ Object
8
9
10
11
12
13
14
|
# File 'lib/deck/container/archive.rb', line 8
def define(file, path: '/', type: :tar)
step do
attributes[:file] = file
attributes[:path] = path
attributes[:type] = type
end
end
|
#export ⇒ Object
16
17
18
|
# File 'lib/deck/container/archive.rb', line 16
def export
attributes[:file]
end
|
#filename ⇒ Object
37
38
39
|
# File 'lib/deck/container/archive.rb', line 37
def filename
File.basename attributes[:file]
end
|
#tar ⇒ Object
25
26
27
|
# File 'lib/deck/container/archive.rb', line 25
def tar
"cd #{attributes[:path]} && tar xf #{filename}"
end
|
#tar_gz ⇒ Object
29
30
31
|
# File 'lib/deck/container/archive.rb', line 29
def tar_gz
"cd #{attributes[:path]} && tar zxf #{filename}"
end
|
#zip ⇒ Object
33
34
35
|
# File 'lib/deck/container/archive.rb', line 33
def zip
"cd #{attributes[:path]} && unzip #{filename}"
end
|