-
Notifications
You must be signed in to change notification settings - Fork 6
/
Vagrantfile
59 lines (53 loc) · 1.49 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
# vi:syntax=ruby
ip_address = "10.1.1.111"
hostname = "aiochat"
box_name = "Samael500/aiochat"
SYNC_FOLDER = true
unless Vagrant.has_plugin?("vagrant-fabric")
raise "
vagrant-fabric is not installed!
please run the follow commands:
$ vagrant plugin install vagrant-fabric
$ sudo apt-get install fabric
"
end
Vagrant.configure(2) do |config|
# Virtual machine parameters
config.vm.box = "#{box_name}"
config.vm.network "private_network", ip: ip_address
config.vm.synced_folder ".", "/vagrant", disabled: true
if SYNC_FOLDER then
if ENV['CI_FLAG'] or ENV['NO_NFS'] then
config.vm.synced_folder ".", "/home/vagrant/proj", type: "rsync"
else
config.vm.synced_folder ".", "/home/vagrant/proj", type: "nfs",
:mount_options => ['actimeo=2']
end
end
config.vm.hostname = hostname
config.vm.post_up_message = "#{hostname} dev server successfuly started.
Connect to host with:
http://#{ip_address}/
or over ssh with `vagrant ssh`
"
# Set box name
config.vm.define :"#{hostname}_vagrant" do |t|
end
# Virtualbox specific parameters
config.vm.provider "virtualbox" do |v|
v.name = "#{hostname}_vagrant"
v.memory = 2048
v.cpus = 2
end
# Provisioning with Fabric
config.vm.provision :fabric do |fabric|
fabric.fabfile_path = "./provision/fabric_provisioner.py"
fabric.tasks = [
"common",
"database",
"nginx",
"app",
]
fabric.tasks.push("localserver") unless ENV['CI_FLAG']
end
end