lib/percheron/actions/build.rb in percheron-0.7.12 vs lib/percheron/actions/build.rb in percheron-0.7.13
- old
+ new
@@ -2,13 +2,14 @@
module Actions
class Build
include Base
- def initialize(unit, nocache: false, exec_scripts: true)
+ def initialize(unit, nocache: false, forcerm: false, exec_scripts: true)
@unit = unit
@nocache = nocache
+ @forcerm = forcerm
@exec_scripts = exec_scripts
end
def execute!
results = []
@@ -19,18 +20,18 @@
results.compact.empty? ? nil : unit
end
private
- attr_reader :unit, :nocache, :exec_scripts
+ attr_reader :unit, :nocache, :forcerm, :exec_scripts
alias_method :exec_scripts?, :exec_scripts
def options
{
'dockerfile' => dockerfile,
't' => unit.image_name,
- 'forcerm' => true,
+ 'forcerm' => forcerm,
'nocache' => nocache
}
end
def dockerfile
@@ -50,10 +51,10 @@
]
end
end
def write_out_temp_dockerfile!
- options = { 'secrets' => Config.secrets }
+ options = { 'secrets' => Config.secrets, 'userdata' => Config.userdata }
content = Liquid::Template.parse(unit.dockerfile.read).render(options)
File.open(temp_dockerfile, 'w') { |f| f.write(content) }
end
def remove_temp_dockerfile!