Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add mechnism to add local Vagrant overrides to "Vagrantfile.local".

  • Loading branch information...
commit 2ba3f38a03d6755fd3790a76a9ad784e83c9870c 1 parent dd43cc4
@igal igal authored
Showing with 11 additions and 2 deletions.
  1. +1 −0  .gitignore
  2. +10 −2 Vagrantfile
View
1  .gitignore
@@ -7,6 +7,7 @@
*~
.dtach
.vagrant
+Vagrantfile.local
config/database~custom.yml
config/geocoder_api_keys.yml
config/mongrel_cluster.yml
View
12 Vagrantfile
@@ -1,3 +1,11 @@
+# Override the settings here by creating a "Vagrantfile.local" file. You can currently use it to override the portforwarding by using commands like:
+# HTTP_PORT = 9999 # Forwarding for VM's port 80
+# RAILS_PORT = 8888 # Forwarding for VM's port 3000
+overrides = "#{__FILE__}.local"
+if File.exist?(overrides)
+ eval File.read(overrides)
+end
+
Vagrant::Config.run do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
@@ -12,8 +20,8 @@ Vagrant::Config.run do |config|
# Forward a port from the guest to the host, which allows for outside
# computers to access the VM, whereas host only networking does not.
- config.vm.forward_port "http", 80, 8080
- config.vm.forward_port "rails", 3000, 8000
+ config.vm.forward_port "http", 80, defined?(HTTP_PORT) ? HTTP_PORT : 8080
+ config.vm.forward_port "rails", 3000, defined?(RAILS_PORT) ? RAILS_PORT : 8000
# Share an additional folder to the guest VM. The first argument is
# an identifier, the second is the path on the guest to mount the
Please sign in to comment.
Something went wrong with that request. Please try again.