Build deb's using common build.py
[integration/packaging.git] / deb / Vagrantfile
1 # -*- mode: ruby -*-
2 # vi: set ft=ruby :
3
4 BOX = "debian/jessie64"
5 BOX_VERSION = "= 8.5.2"
6
7 Vagrant.configure("2") do |config|
8   # Configure VM RAM and CPU for VirtualBox
9   config.vm.provider :virtualbox do |virtualbox, override|
10     virtualbox.memory = 1024
11     # Two cores over default one for faster builds
12     virtualbox.cpus = 2
13     override.vm.box = BOX
14     override.vm.box_version = BOX_VERSION
15   end
16
17   # Configure VM RAM and CPU for LibVirt
18   config.vm.provider :libvirt do |libvirt, override|
19     libvirt.memory = 1024
20     # Two cores over default one for faster builds
21     libvirt.cpus = 2
22     override.vm.box = BOX
23     override.vm.box_version = BOX_VERSION
24   end
25
26   config.vm.provider "docker" do |docker, override|
27     docker.build_dir = "."
28     docker.remains_running = false
29     override.vm.synced_folder ".", "/build"
30   end
31
32   # NFS is fragile, disable it and use rsync
33   config.nfs.functional = false
34
35   # Sync folders /packaging/deb/ and /vagrant
36   config.vm.synced_folder ".", "/vagrant"
37
38   # Update package info to prevent old info from causing 404s during install
39   config.vm.provision "shell", inline: "apt-get update"
40
41   # Install pkg dev tools, Python libs for build scripts, gdebi to test install
42   config.vm.provision "shell", inline: "apt-get install -y --force-yes \
43                                             build-essential \
44                                             devscripts \
45                                             equivs \
46                                             dh-systemd \
47                                             python-yaml \
48                                             python-jinja2 \
49                                             gdebi
50                                             "
51
52   # Add jessie-backports
53   config.vm.provision "shell", inline: <<-SHELL
54     echo "deb http://httpredir.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/jessie-backports.list
55     apt-get update
56   SHELL
57 end