Class: DaptivChefCI::VirtualBoxBaseBoxBuilder
- Inherits:
-
Object
- Object
- DaptivChefCI::VirtualBoxBaseBoxBuilder
- Defined in:
- lib/daptiv-chef-ci/virtualbox_basebox_builder.rb
Overview
This class builds VBox Vagrant boxes
Instance Method Summary collapse
-
#build(box_file) ⇒ Object
Packages a VBox Vagrant box.
-
#initialize(base_dir, shell) ⇒ VirtualBoxBaseBoxBuilder
constructor
Creates a new box builder instance.
Constructor Details
#initialize(base_dir, shell) ⇒ VirtualBoxBaseBoxBuilder
Creates a new box builder instance
of the box we want to package, i.e. /Users/admin/src/dotnetframework
15 16 17 18 19 |
# File 'lib/daptiv-chef-ci/virtualbox_basebox_builder.rb', line 15 def initialize(base_dir, shell) @shell = shell @base_dir = base_dir @logger = Log4r::Logger.new("daptiv_chef_ci::vmware_base_box_builder") end |
Instance Method Details
#build(box_file) ⇒ Object
Packages a VBox Vagrant box. This can take 15 minutes or so.
24 25 26 27 28 29 30 |
# File 'lib/daptiv-chef-ci/virtualbox_basebox_builder.rb', line 24 def build(box_file) Dir.chdir(@base_dir) { @logger.info("Packaging box #{box_file}") FileUtils.rm(box_file) if File.exists?(box_file) @shell.exec_cmd("vagrant package --output #{box_file}", 3600) } end |