Browse Source

Add Vagrantfile

Brian Waldon 12 years ago
parent
commit
6f054827a3
2 changed files with 35 additions and 0 deletions
  1. 4 0
      .gitignore
  2. 31 0
      Vagrantfile

+ 4 - 0
.gitignore

@@ -4,3 +4,7 @@ pkg/
 /go-bindata
 /go-bindata
 release_version.go
 release_version.go
 /machine*
 /machine*
+.vagrant/
+conf
+info
+log

+ 31 - 0
Vagrantfile

@@ -0,0 +1,31 @@
+# This Vagrantfile is targeted at developers. It can be used to build and run etcd in an isolated VM.
+
+$provision = <<SCRIPT
+
+apt-get update
+apt-get install -y python-software-properties git
+add-apt-repository -y ppa:duh/golang
+apt-get update
+apt-get install -y golang
+
+cd /vagrant && ./build
+
+/vagrant/etcd -c 0.0.0.0:4001 -s 0.0.0.0:7001 &
+
+SCRIPT
+
+
+Vagrant.configure("2") do |config|
+    config.vm.box = 'precise64'
+    config.vm.box_url = 'http://files.vagrantup.com/precise64.box'
+
+    config.vm.provider "virtualbox" do |vbox|
+        vbox.customize ["modifyvm", :id, "--memory", "1024"]
+    end
+
+    config.vm.provision "shell", inline: $provision
+
+    config.vm.network "forwarded_port", guest: 4001, host: 4001, auto_correct: true
+    config.vm.network "forwarded_port", guest: 7001, host: 7001, auto_correct: true
+
+end