Class: BuildRunner
Instance Attribute Summary collapse
-
#builder ⇒ Object
readonly
Returns the value of attribute builder.
-
#parallel ⇒ Object
readonly
Returns the value of attribute parallel.
-
#templates ⇒ Object
readonly
Returns the value of attribute templates.
Instance Method Summary collapse
-
#initialize(opts) ⇒ BuildRunner
constructor
A new instance of BuildRunner.
- #start ⇒ Object
Methods included from Common
#audio?, #banner, #bootstrap_aws, #build_nodes, #calculate_templates, #conf, #create_infranodes_json, #duration, #gen_ssh_key, #gen_x509_cert, #info, #infranodes, #is_mac?, #linux, #lock, #logs, #parse_log, #update_lock, #update_template, #warn, #wombat, #workstations
Constructor Details
#initialize(opts) ⇒ BuildRunner
Returns a new instance of BuildRunner.
12 13 14 15 16 |
# File 'lib/wombat/build.rb', line 12 def initialize(opts) @templates = opts.templates.nil? ? calculate_templates : opts.templates @builder = opts.builder.nil? ? "amazon-ebs" : opts.builder @parallel = opts.parallel end |
Instance Attribute Details
#builder ⇒ Object (readonly)
Returns the value of attribute builder.
10 11 12 |
# File 'lib/wombat/build.rb', line 10 def builder @builder end |
#parallel ⇒ Object (readonly)
Returns the value of attribute parallel.
10 11 12 |
# File 'lib/wombat/build.rb', line 10 def parallel @parallel end |
#templates ⇒ Object (readonly)
Returns the value of attribute templates.
10 11 12 |
# File 'lib/wombat/build.rb', line 10 def templates @templates end |
Instance Method Details
#start ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/wombat/build.rb', line 18 def start if which('packer').nil? raise "packer binary not found in path, exiting..." end ("Generating certs (if necessary)") wombat['certs'].each do |hostname| gen_x509_cert(hostname) end ("Generating SSH keypair (if necessary)") gen_ssh_key time = Benchmark.measure do ("Starting build for templates: #{templates}") aws_region_check if builder == 'amazon-ebs' templates.each do |t| vendor_cookbooks(t) end if parallel.nil? build_hash.each do |k, v| build(v['template'], v['options']) end else build_parallel(templates) end end shell_out_command("say -v fred \"Wombat has made an #{build_hash.keys.to_s}\" for you") if audio? ("Build finished in #{duration(time.real)}.") end |