vagrant: updated Vagrantfile to use rsync

Replacing problematic nfs & git clone, with a simplier rsync.

Change-Id: I26a95bd81b7fbf6ea0179cd62361e0902f2d22ed
Signed-off-by: Ray Kinsella <ray.kinsella@intel.com>
This commit is contained in:
Ray Kinsella
2016-12-21 12:10:43 +00:00
committed by Damjan Marion
parent 33e81950cf
commit ee49bf82f5
2 changed files with 16 additions and 58 deletions

View File

@ -14,9 +14,8 @@ Vagrant.configure(2) do |config|
config.vm.box_check_update = false
config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"update.sh")
config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"clone.sh")
config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"build.sh"), :args => "/home/vagrant/git/vpp vagrant"
config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"install.sh"), :args => "/home/vagrant/git/vpp"
config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"build.sh"), :args => "/vpp vagrant"
config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"install.sh"), :args => "/vpp"
config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"clearinterfaces.sh")
config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"run.sh")
@ -63,7 +62,20 @@ Vagrant.configure(2) do |config|
config.ssh.forward_agent = true
config.vm.synced_folder "../../", "/vpp", disabled: false
config.vm.synced_folder "../../", "/vpp", type: "rsync",
rsync__auto: false,
rsync__exclude: [
"build-root/build*/",
"build-root/install*/",
"build-root/images*/",
"build-root/*.deb",
"build-root/*.rpm",
"build-root/*.changes",
"build-root/python",
"build-root/deb/debian/*.dkms",
"build-root/deb/debian/*.install",
"build-root/deb/debian/changes",
"build-root/tools"]
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--ioapic", "on"]

View File

@ -1,54 +0,0 @@
#!/bin/bash
# Figure out what system we are running on
if [ -f /etc/lsb-release ];then
. /etc/lsb-release
elif [ -f /etc/redhat-release ];then
sudo yum install -y redhat-lsb
DISTRIB_ID=`lsb_release -si`
DISTRIB_RELEASE=`lsb_release -sr`
DISTRIB_CODENAME=`lsb_release -sc`
DISTRIB_DESCRIPTION=`lsb_release -sd`
fi
KERNEL_OS=`uname -o`
KERNEL_MACHINE=`uname -m`
KERNEL_RELEASE=`uname -r`
KERNEL_VERSION=`uname -v`
echo KERNEL_OS: $KERNEL_OS
echo KERNEL_MACHINE: $KERNEL_MACHINE
echo KERNEL_RELEASE: $KERNEL_RELEASE
echo KERNEL_VERSION: $KERNEL_VERSION
echo DISTRIB_ID: $DISTRIB_ID
echo DISTRIB_RELEASE: $DISTRIB_RELEASE
echo DISTRIB_CODENAME: $DISTRIB_CODENAME
echo DISTRIB_DESCRIPTION: $DISTRIB_DESCRIPTION
# Make sure git is installed
if [ $DISTRIB_ID == "CentOS" ]; then
yum -y install git
elif [ $DISTRIB_ID == "Ubuntu" ]; then
apt-get -y install git
fi
# Setup the vpp code
cd ~vagrant/
sudo -u vagrant mkdir git
cd git/
echo "SSH_AUTH_SOCK $SSH_AUTH_SOCK x"
chmod 777 $SSH_AUTH_SOCK
CLONE_URL=`cd /vpp;git remote -v | grep origin |grep fetch |awk '{print $2}'`
echo "CLONE_URL $CLONE_URL"
echo $CLONE_URL | grep -q "^ssh:"
if [ $? == 0 ]; then
SSH_HOST=`echo $CLONE_URL| awk -F/ '{print $3}'`
SSH_PORT=`echo $SSH_HOST| awk -F: '{print $2}'`
if [ -n $SSH_PORT ]; then
SSH_PORT="-p $SSH_PORT"
fi
SSH_HOST=`echo $SSH_HOST| awk -F: '{print $1}'`
echo "SSH_HOST $SSH_HOST"
echo "SSH_PORT $SSH_PORT"
sudo -HE -u vagrant ssh -oStrictHostKeyChecking=no -v $SSH_PORT $SSH_HOST
fi
sudo -HE -u vagrant git clone $CLONE_URL