8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/ufo/docker/compiler.rb', line 8
def compile
return unless File.exist?(@erb_file)
puts "Compiled #{File.basename(@erb_file).color(:green)} to #{File.basename(@dockerfile).color(:green)}"
path = "#{Ufo.root}/.ufo/settings/dockerfile_variables.yml"
vars = YAML.load_file(path)[Ufo.env] if File.exist?(path)
vars ||= {}
result = RenderMePretty.result(@erb_file, vars)
=" # Note this file was generated from \#{File.basename(@erb_file)} as a part of running ufo ship\"\n # To update the FROM statement with the latest base docker image run: ufo docker base\n EOL\n result = \"\#{comment}\\n\#{result}\"\n IO.write(@dockerfile, result)\nend\n".chop
|