scripts/vagrant: Create prebuild box and allow using spdk boxes
Build local vagrant box and add it to local vagrant box list. Check if spdk box exist and use it instead of generic boxes. Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com> Change-Id: Ib3b87c9783354680657f96b5b5adea1706712c5e Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/848 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Karol Latecki <karol.latecki@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
dd9a88cc7f
commit
344c318464
11
scripts/vagrant/Vagrantfile
vendored
11
scripts/vagrant/Vagrantfile
vendored
@ -1,12 +1,21 @@
|
|||||||
# -*- mode: ruby -*-
|
# -*- mode: ruby -*-
|
||||||
# vi: set ft=ruby :
|
# vi: set ft=ruby :
|
||||||
|
|
||||||
|
require 'open3' def checkboxtype(distro)
|
||||||
|
localboxes, stderr, status = Open3.capture3("vagrant box list")
|
||||||
|
if localboxes.include? "spdk/"+distro
|
||||||
|
return "spdk/"+distro
|
||||||
|
else
|
||||||
|
return "generic/"+distro
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
Vagrant.configure(2) do |config|
|
Vagrant.configure(2) do |config|
|
||||||
|
|
||||||
# Pick the right distro and bootstrap, default is fedora30
|
# Pick the right distro and bootstrap, default is fedora30
|
||||||
distro = ( ENV['SPDK_VAGRANT_DISTRO'] || "fedora30")
|
distro = ( ENV['SPDK_VAGRANT_DISTRO'] || "fedora30")
|
||||||
provider = (ENV['SPDK_VAGRANT_PROVIDER'] || "virtualbox")
|
provider = (ENV['SPDK_VAGRANT_PROVIDER'] || "virtualbox")
|
||||||
config.vm.box = "generic/"+distro
|
config.vm.box = checkboxtype(distro)
|
||||||
config.vm.box_check_update = false
|
config.vm.box_check_update = false
|
||||||
|
|
||||||
# Copy in the .gitconfig if it exists
|
# Copy in the .gitconfig if it exists
|
||||||
|
@ -320,6 +320,9 @@ EOF
|
|||||||
vagrant ssh -c 'sudo pkg clean -ay'
|
vagrant ssh -c 'sudo pkg clean -ay'
|
||||||
fi
|
fi
|
||||||
vagrant ssh -c 'cat /dev/null > ~/.bash_history && history -c'
|
vagrant ssh -c 'cat /dev/null > ~/.bash_history && history -c'
|
||||||
|
vagrant package --output spdk_${SPDK_VAGRANT_DISTRO}.box
|
||||||
|
vagrant box add spdk/${SPDK_VAGRANT_DISTRO} spdk_${SPDK_VAGRANT_DISTRO}.box &&
|
||||||
|
rm spdk_${SPDK_VAGRANT_DISTRO}.box
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
echo " SUCCESS!"
|
echo " SUCCESS!"
|
||||||
|
Loading…
Reference in New Issue
Block a user