Class: Wombat::BuildRunner
- Inherits:
-
Object
- Object
- Wombat::BuildRunner
- Defined in:
- lib/wombat/build.rb
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 Crypto
Methods included from Common
#audio?, #banner, #bootstrap_aws, #build_nodes, #calculate_templates, #conf, #create_infranodes_json, #duration, #info, #infranodes, #is_mac?, #is_valid_json?, #linux, #lock, #logs, #parse_log, #update_lock, #update_template, #warn, #wombat, #workstations
Constructor Details
#initialize(opts) ⇒ BuildRunner
Returns a new instance of BuildRunner.
17 18 19 20 21 22 23 24 |
# File 'lib/wombat/build.rb', line 17 def initialize(opts) @templates = opts.templates.nil? ? calculate_templates : opts.templates @builder = opts.builder.nil? ? "amazon-ebs" : opts.builder @parallel = opts.parallel @wombat_yml = opts.wombat_yml unless opts.wombat_yml.nil? @debug = opts.debug @no_vendor = opts.vendor end |
Instance Attribute Details
#builder ⇒ Object (readonly)
Returns the value of attribute builder.
15 16 17 |
# File 'lib/wombat/build.rb', line 15 def builder @builder end |
#parallel ⇒ Object (readonly)
Returns the value of attribute parallel.
15 16 17 |
# File 'lib/wombat/build.rb', line 15 def parallel @parallel end |
#templates ⇒ Object (readonly)
Returns the value of attribute templates.
15 16 17 |
# File 'lib/wombat/build.rb', line 15 def templates @templates end |
Instance Method Details
#start ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/wombat/build.rb', line 26 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 # If running on azure ensure that the resource group and storage account exist prepare_azure if builder == "azure-arm" time = Benchmark.measure do ("Starting build for templates: #{templates}") aws_region_check if builder == 'amazon-ebs' templates.each do |t| vendor_cookbooks(t) unless @no_vendor 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}\" for you") if audio? ("Build finished in #{duration(time.real)}.") end |