4 # Vagrantfile API/syntax version.
5 VAGRANTFILE_API_VERSION = "2"
7 Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
8 # Configure VM RAM and CPU for VirtualBox. Change this to meet your needs.
9 config.vm.provider :virtualbox do |virtualbox, override|
10 virtualbox.memory = 2048
14 # Configure VM RAM and CPU for LibVirt. Change this to meet your needs.
15 config.vm.provider :libvirt do |libvirt, override|
20 # NFS is fragile, use rsync
21 config.vm.synced_folder ".", "/home/vagrant/sync", disabled: true
22 config.vm.synced_folder ".", "/vagrant", type: "rsync",
23 rsync__exclude: [".git/", "*.rpm", "*.tar.gz", "*.zip", "karaf-*",
24 "distribution-karaf-*"]
26 # Define RPM build env
27 config.vm.define :centos do |centos|
28 # Build Vagrant box based on CentOS 7
29 centos.vm.box = "centos/7"
31 # TODO: This doesn't work
32 centos.vm.provider "docker" do |docker, override|
33 docker.build_dir = "rpm"
34 docker.remains_running = false
35 override.vm.synced_folder ".", "/build"
38 # Add EPEL for access to fedora-packager and maybe others
39 centos.vm.provision "shell", inline: "yum install -y epel-release"
41 # Install required software
42 # fedora-packager: Basic RPM packaging software
43 centos.vm.provision "shell", inline: "yum install -y fedora-packager \
46 # Use the distribution's version of pip to upgrade to the latest pip
47 centos.vm.provision "shell", inline: "pip install --upgrade pip"
49 # Install Python dependences system-wide via pip.
50 centos.vm.provision "shell", inline: "pip install -r /vagrant/requirements.txt"
52 # Add vagrant user to mock group for rpmbuild
53 centos.vm.provision "shell", inline: "sudo usermod -a -G mock vagrant"
56 # Define .deb build env
57 config.vm.define :debian do |debian|
58 # Build Vagrant box based on Debian 9
59 debian.vm.box = "debian/stretch64"
61 # TODO: This doesn't work
62 debian.vm.provider "docker" do |docker, override|
63 docker.build_dir = "deb"
64 docker.remains_running = false
65 override.vm.synced_folder ".", "/build"
68 # Update package info to prevent old info from causing 404s during install
69 debian.vm.provision "shell", inline: "apt-get update"
71 # Install pkg dev tools, Python libs for build scripts, gdebi to test install
72 debian.vm.provision "shell", inline: "apt-get install -y build-essential \
80 # Use the distribution's version of pip to upgrade to the latest pip
81 debian.vm.provision "shell", inline: "pip install --upgrade pip"
83 # Install Python dependences system-wide via pip
84 debian.vm.provision "shell", inline: "pip install -r /vagrant/requirements.txt"