Switched vagrant for ~/git/vpp to /vpp 01/201/2
authorEd Warnicke <eaw@cisco.com>
Wed, 3 Feb 2016 01:47:17 +0000 (17:47 -0800)
committerGerrit Code Review <gerrit@fd.io>
Wed, 3 Feb 2016 14:49:37 +0000 (14:49 +0000)
build-root/vagrant/Vagrantfile

was always mounting the vpp into /vpp
Now rather than cloning it and building,
we just use it as mounted.

In order to let folks know what happened,
a README.moved is copied into the ~/git/vpp
so folks know what happened.

In addition to make it easier for folks
to do commits from withing the vagrant,
we install git-review, and copy in the
users .gitconfig and .gnupg directory.

A couple of notes about this. VMWare goes much
much faster in all cases.  Virtualbox is a
bit slower in the very first run (without ccache).

One of the benefits of using the mounted /vpp though
is that after your first vagrant up, you always
have access to the .ccache, as it lives
outside the vagrant, and so in steady state
everything is faster.

Change-Id: I2cd2c28181b3d7e664240dfe2249b5be3f1b9241
Signed-off-by: Ed Warnicke <eaw@cisco.com>
build-root/vagrant/README.moved [new file with mode: 0644]
build-root/vagrant/Vagrantfile
build-root/vagrant/bootstrap.ubuntu1404.sh

diff --git a/build-root/vagrant/README.moved b/build-root/vagrant/README.moved
new file mode 100644 (file)
index 0000000..2bbf656
--- /dev/null
@@ -0,0 +1,5 @@
+The location of the vpp code has moved from
+~/git/vpp
+To 
+/vpp
+/vpp is a mount of the source code from outside the Vagrant, and should make it much easier to interact with the system.
index f00233d..f402165 100644 (file)
@@ -13,6 +13,22 @@ Vagrant.configure(2) do |config|
     config.vm.provision 'shell', path: 'bootstrap.ubuntu1404.sh'
   end
 
+  # Add .gnupg dir in so folks can sign patches
+  # Note, as gnupg puts socket files in that dir, we have
+  # to be cautious and make sure we are dealing with a plain file
+  homedir = File.expand_path("~/")
+  Dir["#{homedir}/.gnupg/**/*"].each do |fname|
+    if File.file?(fname)
+      destname = fname.sub(Regexp.escape("#{homedir}/"),'')
+      config.vm.provision "file", source: fname, destination: destname
+    end
+  end
+
+  # Copy in the .gitconfig if it exists
+  if File.file?(File.expand_path("~/.gitconfig"))
+    config.vm.provision  "file", source: "~/.gitconfig", destination: ".gitconfig"
+  end
+
   # vagrant-cachier caches apt/yum etc to speed subsequent
   # vagrant up
   # to enable, run
index 35865fa..a8381bb 100644 (file)
@@ -10,7 +10,7 @@ apt-get upgrade -y
 sudo update-alternatives --install /bin/sh sh /bin/bash 100
 
 # Install build tools
-apt-get install -y build-essential autoconf automake bison libssl-dev ccache libtool git dkms debhelper emacs libganglia1-dev libapr1-dev libconfuse-dev
+apt-get install -y build-essential autoconf automake bison libssl-dev ccache libtool git dkms debhelper emacs libganglia1-dev libapr1-dev libconfuse-dev git-review
 
 # Install other stuff
 # apt-get install -y qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils
@@ -49,13 +49,10 @@ start hugepages
 # Setup the vpp code
 cd ~vagrant/
 
-sudo -u vagrant mkdir git
-cd git/
+sudo -u vagrant mkdir -p git/vpp
+cp /vagrant/README.moved git/vpp/
 
-# Check if git exists and remove it before attempting clone, else clone ineffective when "reload --provision"
-[ -d vpp ] && rm -rf vpp
-sudo -H -u vagrant git clone /vpp
-cd vpp/
+cd /vpp/
 
 # Initial vpp build
 if [ -d build-root ]; then