forked from deanmalmgren/textract
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
65 lines (53 loc) · 2.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
57
58
59
60
61
62
63
64
65
# -*- mode: ruby -*-
# vi: set ft=ruby :
# If there are any problems with the required gems, vagrant
# has its own ruby environment. To install the gems (iniparse,
# for example), you need to run:
#
# $ vagrant plugin install iniparse
#
# For more details, check out:
# https://docs.vagrantup.com/v2/cli/plugin.html
require 'iniparse'
Vagrant.configure("2") do |config|
# preliminaries
root_dir = File.dirname(__FILE__)
#################################################### VIRTUALBOX PROVIDER SETUP
# global configuration on the virtualbox provider. for all available
# options, see http://www.virtualbox.org/manual/ch08.html
virtualbox_server_name = "dev"
config.vm.provider :virtualbox do |vb, override_config|
vb.gui = false
# http://stackoverflow.com/a/17126363/892506
vb.customize ["modifyvm", :id, "--ioapic", "on"]
vb.customize ["modifyvm", :id, "--cpus", "2"]
vb.customize ["modifyvm", :id, "--memory", "2048"]
override_config.vm.box = "precise64"
override_config.vm.box_url = "http://files.vagrantup.com/precise64.box"
end
# steps for provisioning so that these provisioning steps are
# properly executed in this virtual machine and also on travis-ci
def provision_script(config, script_path)
config.vm.provision "shell" do |s|
s.path = script_path
s.args = "/vagrant"
end
end
################################################################# LOCAL SERVER
config.vm.define virtualbox_server_name do |server_config|
server_config.vm.hostname = virtualbox_server_name
# NOTE: this is a tentative hack. the way to properly do this
# would be to use the official ci-environments
# http://docs.travis-ci.com/user/ci-environment/, which are built
# using chef recipes from here
# https://github.com/travis-ci/travis-cookbooks/
provision_script(server_config, "provision/travis-mock.sh")
# these are the same provisioning steps that are done on travis-ci
# as on the virtual machine
provision_script(server_config, "provision/debian.sh")
provision_script(server_config, "provision/python.sh")
# these provisioning steps are only done locally as a convenience
# for setting up a useful development environment
provision_script(server_config, "provision/development.sh")
end
end