Class: Percheron::Actions::Build

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/percheron/actions/build.rb

Instance Method Summary collapse

Methods included from Base

#base_dir, #in_working_directory

Constructor Details

#initialize(unit, usecache: true, forcerm: false, exec_scripts: true) ⇒ Build

Returns a new instance of Build.



6
7
8
9
10
11
# File 'lib/percheron/actions/build.rb', line 6

def initialize(unit, usecache: true, forcerm: false, exec_scripts: true)
  @unit = unit
  @usecache = usecache
  @forcerm = forcerm
  @exec_scripts = exec_scripts
end

Instance Method Details

#execute!Object



13
14
15
16
17
18
19
20
# File 'lib/percheron/actions/build.rb', line 13

def execute!
  results = []
  if unit.buildable?
    results << write_out_temp_dockerfile!
    results << build!
  end
  results.compact.empty? ? nil : unit
end