20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/kerby/cli.rb', line 20
def build(*src_manifests)
load_k8s_node(options[:node_yaml])
temp_name = sprintf("/tmp/kerby-%s-%s.yml",
Time.now.strftime("%Y%m%d-%H%M%S"),
SecureRandom.alphanumeric(8).downcase)
t = File.open(temp_name, 'w')
for src_manifest in src_manifests do
saved_file = @_curr_file; @_curr_file = src_manifest
File.write(t.path, ERB.new(File.read(src_manifest)).result(binding))
end
t.close
File.open(temp_name) do |f|
while s = f.gets do
print s
end
end
FileUtils.rm_f(temp_name)
@_curr_file = saved_file
end
|