Created
October 19, 2012 15:34
-
-
Save bennylope/3918879 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if CONF.has_key?("mounts") | |
CONF['mounts'].each do |folder| | |
config.vm.share_folder(folder['name'], folder['virtual'], folder['host'], :nfs => true) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nfs: true | |
mounts: | |
- name: "code" | |
virtual: "/var/code" | |
host: "~/Code" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "yaml" | |
# Load up our vagrant config files -- vagrantconfig.yaml first | |
_config = YAML.load(File.open(File.join(File.dirname(__FILE__), | |
"vagrantconfig.yaml"), File::RDONLY).read) | |
# Local-specific/not-git-managed config -- vagrantconfig_local.yaml | |
begin | |
_config.merge!(YAML.load(File.open(File.join(File.dirname(__FILE__), | |
"vagrantconfig_local.yaml"), File::RDONLY).read)) | |
rescue Errno::ENOENT # No vagrantconfig_local.yaml found -- that's OK; just | |
# use the defaults. | |
end | |
CONF = _config | |
MOUNT_POINT = '/var/apps/myapp/source' | |
Vagrant::Config.run do |config| | |
# Box set up stuff removed | |
if CONF['nfs'] == false or RUBY_PLATFORM =~ /mswin(32|64)/ | |
nfs = false | |
end | |
config.vm.share_folder("app_root", MOUNT_POINT, ".", :nfs => nfs) | |
if CONF.has_key?("mounts") | |
CONF['mounts'].each do |folder| | |
config.vm.share_folder(folder['name'], folder['virtual'], folder['host'], :nfs => true) | |
end | |
end | |
# Provisioning removed | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment