forked from worstcase/blockade
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Vagrantfile
56 lines (40 loc) · 1.28 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
VAGRANTFILE_API_VERSION = "2"
BOX_NAME = ENV['BOX_NAME'] || "ubuntu/trusty64"
script = <<SCRIPT
#!/bin/bash -e
if [ ! -e /vagrant/blockade ]; then
echo "/vagrant/blockade not found. are we in a vagrant blockade environment??" >&2
exit 1
fi
if [ ! -f /etc/default/docker ]; then
echo "/etc/default/docker not found -- is docker installed?" >&2
exit 1
fi
apt-get update
apt-get -y install python-pip python-virtualenv
cd /vagrant
export PIP_DOWNLOAD_CACHE=/vagrant/.pip_download_cache
# install into system python for manual testing
python setup.py develop
# apt version of tox is still too old in trusty
pip install tox
tox
SCRIPT
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = BOX_NAME
if Vagrant.has_plugin?("vagrant-cachier")
config.cache.scope = :box
end
config.vm.provider :virtualbox do |vb, override|
end
# there are obviously vagrant versions with a
# broken 'docker' provisioner that can be fixed
# by invoking an 'apt-get update' *before* docker itself
config.vm.provision "shell", inline: "apt-get update"
# fetch the ubuntu:latest image that is required for
# the test suite
config.vm.provision "docker",
images: ["ubuntu"]
# kick off the tests automatically
config.vm.provision "shell", inline: script
end