]> go.fuhry.dev Git - fsnotify.git/commitdiff
Vagrant file for Linux 32-bit, ref #59
authorNathan Youngman <git@nathany.com>
Sun, 8 Sep 2013 06:59:59 +0000 (00:59 -0600)
committerNathan Youngman <git@nathany.com>
Sun, 8 Sep 2013 16:18:54 +0000 (10:18 -0600)
* git ignore .vagrant
* fixup example test to use the github path (otherwise need to install as a test dependency)

.gitignore [new file with mode: 0644]
Vagrantfile [new file with mode: 0644]
example_test.go

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..e4706a9
--- /dev/null
@@ -0,0 +1,5 @@
+# Setup a Global .gitignore for OS and editor generated files:
+# https://help.github.com/articles/ignoring-files
+# git config --global core.excludesfile ~/.gitignore_global
+
+.vagrant
diff --git a/Vagrantfile b/Vagrantfile
new file mode 100644 (file)
index 0000000..ac6f26d
--- /dev/null
@@ -0,0 +1,47 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
+VAGRANTFILE_API_VERSION = "2"
+
+# shell script to bootstrap Go on Linux
+GO_LINUX = 'go1.1.2.linux-386.tar.gz'
+# Everything after /src/ in the host operating system's path
+PROJECT_PATH = File.dirname(__FILE__).partition("#{File::SEPARATOR}src#{File::SEPARATOR}").last
+PARENT_PATH = File.split(PROJECT_PATH).first
+
+$bootstrap_linux = <<SCRIPT
+apt-get update -qq
+apt-get install -qq -y git mercurial bzr curl
+
+if ! [ -f /home/vagrant/#{GO_LINUX} ]; then
+  response=$(curl -O# https://go.googlecode.com/files/#{GO_LINUX})
+fi
+tar -C /usr/local -xzf #{GO_LINUX}
+
+su vagrant -c "mkdir -p /home/vagrant/go/src/#{PARENT_PATH}"
+su vagrant -c "ln -s /vagrant /home/vagrant/go/src/#{PROJECT_PATH}"
+
+echo 'export GOPATH=$HOME/go' >> /home/vagrant/.profile
+echo 'export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin' >> /home/vagrant/.profile
+echo 'cd $GOPATH/src/#{PROJECT_PATH}' >> /home/vagrant/.profile
+
+su -l vagrant -c "go get -d -v ./..."
+
+echo "\nRun: vagrant ssh -c 'go test -v ./...'"
+SCRIPT
+
+Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
+
+  config.vm.define "linux" do |linux|
+    # Every Vagrant virtual environment requires a box to build off of.
+    linux.vm.box = "precise32"
+
+    # The url from where the 'config.vm.box' box will be fetched if it
+    # doesn't already exist on the user's system.
+    linux.vm.box_url = "http://files.vagrantup.com/precise32.box"
+
+    linux.vm.provision :shell, :inline => $bootstrap_linux
+  end
+
+end
index 37c0d0c5f35261cb752396aecd392516dd4b3c1c..d3130e222642192d3cab938c9c1fa9baf4326942 100644 (file)
@@ -7,7 +7,7 @@ package fsnotify_test
 import (
        "log"
 
-       "code.google.com/p/go.exp/fsnotify"
+       "github.com/howeyc/fsnotify"
 )
 
 func ExampleNewWatcher() {