add Vagrantfile to support cross-platform development
authorGabe Rosenhouse <grosenhouse@pivotal.io>
Wed, 7 Jun 2017 03:13:31 +0000 (20:13 -0700)
committerGabe Rosenhouse <grosenhouse@pivotal.io>
Wed, 7 Jun 2017 03:13:31 +0000 (20:13 -0700)
Update CONTRIBUTING to reflect plugin split

.gitignore
CONTRIBUTING.md
Vagrantfile [new file with mode: 0644]

index db1b355..b72c2de 100644 (file)
@@ -25,3 +25,4 @@ _testmain.go
 
 bin/
 gopath/
+.vagrant
index 817f072..0108d70 100644 (file)
@@ -51,12 +51,21 @@ We generally require test coverage of any new features or bug fixes.
 Here's how you can run the test suite on any system (even Mac or Windows) using
  [Vagrant](https://www.vagrantup.com/) and a hypervisor of your choice:
 
+First, ensure that you have the [CNI repo](https://github.com/containernetworking/cni) and this repo (plugins) cloned side-by-side:
+```bash
+cd ~/workspace
+git clone https://github.com/containernetworking/cni
+git clone https://github.com/containernetworking/plugins
+```
+
+Next, boot the virtual machine and SSH in to run the tests:
+
 ```bash
 vagrant up
 vagrant ssh
 # you're now in a shell in a virtual machine
 sudo su
-cd /go/src/github.com/containernetworking/cni
+cd /go/src/github.com/containernetworking/plugins
 
 # to run the full test suite
 ./test.sh
diff --git a/Vagrantfile b/Vagrantfile
new file mode 100644 (file)
index 0000000..7c5f8f1
--- /dev/null
@@ -0,0 +1,21 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+Vagrant.configure(2) do |config|
+  config.vm.box = "bento/ubuntu-16.04"
+
+  config.vm.synced_folder "..", "/go/src/github.com/containernetworking"
+
+  config.vm.provision "shell", inline: <<-SHELL
+    set -e -x -u
+
+    apt-get update -y || (sleep 40 && apt-get update -y)
+    apt-get install -y git
+
+    wget -qO- https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz | tar -C /usr/local -xz
+
+    echo 'export GOPATH=/go' >> /root/.bashrc
+    echo 'export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin' >> /root/.bashrc
+    cd /go/src/github.com/containernetworking/plugins
+  SHELL
+end