Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Allow user to specify vagrantfile and included files. #167

Closed
wants to merge 2 commits into from

1 participant

@eclubb

Added ability to process :vagrantfile and :include_files defined in definition.rb

For example:

# work/definitions/boxname/definition.rb
Veewee::Session.declare({
  :vagrantfile => File.expand_path('../Vagrantfile.pkg', __FILE__),
  :include_files => 'file1' # or ['file1', 'file2']
})

where Vagrantfile.pkg is in work/definitions/boxname/ and file1 is in work/.

@eclubb

Closing this, since it's for 0.2.x. Will open new pr with changes applied to new master.

@eclubb eclubb closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 4 deletions.
  1. +12 −4 lib/veewee/export.rb
View
16 lib/veewee/export.rb
@@ -47,9 +47,17 @@ def self.vagrant(boxname,boxdir,definition)
end
puts "Excuting vagrant voodoo:"
- export_command="vagrant package --base '#{boxname}' --output '#{box_path}'"
- puts "#{export_command}"
- Veewee::Shell.execute("#{export_command}") #hmm, needs to get the gem_home set?
+
+ export_command = "vagrant package --base '#{boxname}' --output '#{box_path}'"
+
+ export_command += " --vagrantfile '#{definition[:vagrantfile]}'" if definition[:vagrantfile]
+
+ include_files = [definition[:include_files]].flatten.compact
+ include_files.map! { |filename| "'#{filename}'" }
+ export_command += " --include #{include_files.join(' ')}" unless include_files.empty?
+
+ puts export_command
+ Veewee::Shell.execute(export_command) #hmm, needs to get the gem_home set?
puts
#add_ssh_nat_mapping back!!!!
@@ -78,4 +86,4 @@ def self.vagrant(boxname,boxdir,definition)
#vagrant export disables the machine
-# thebox.ssh_enable_vmachine({:hostport => host_port , :guestport => 22} )
+# thebox.ssh_enable_vmachine({:hostport => host_port , :guestport => 22} )
Something went wrong with that request. Please try again.