This repository has been archived by the owner on Oct 20, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Vagrantfile
84 lines (75 loc) · 2.36 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
Vagrant.configure("2") do |config|
##
# Box
#
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.hostname = "croogo"
##
# Memory
#
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "768"]
end
##
# IP
#
config.vm.network :private_network, ip: "16.17.18.19"
##
# Shared directories
#
config.vm.synced_folder Dir.pwd, "/vagrant", :nfs => true
##
# Upgrade Chef
#
config.vm.provision :shell, :inline => "gem install chef --version 11.6 --no-rdoc --no-ri --conservative"
##
# Chef
#
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = ["cookbooks"]
chef.add_recipe :apt
chef.add_recipe "build-essential"
chef.add_recipe "curl"
chef.add_recipe "git"
chef.add_recipe "mysql::server"
chef.add_recipe "nginx"
chef.add_recipe "nodejs"
chef.add_recipe "php"
chef.add_recipe "php-fpm"
chef.add_recipe "phpunit"
chef.add_recipe "users::sysadmins"
chef.add_recipe "vim"
chef.json = {
:git => {
:prefix => "/usr/local"
},
:mysql => {
:server_root_password => 'password',
:server_repl_password => 'password',
:server_debian_password => 'password',
:allow_remote_root => true
},
:nginx => {
:dir => "/etc/nginx",
:log_dir => "/var/log/nginx",
:binary => "/usr/sbin/nginx",
:user => "www-data",
:init_style => "runit",
:pid => "/var/run/nginx.pid",
:worker_connections => "1024"
}
}
end
config.vm.provision :shell, :inline => "cd /vagrant && make composer"
config.vm.provision :shell, :inline => "cd /vagrant && make npm"
config.vm.provision :shell, :inline => "cd /vagrant && make bower"
config.vm.provision :shell, :inline => "cd /vagrant && make build"
config.vm.provision :shell, :inline => "cd /vagrant && make nginx"
config.vm.provision :shell, :inline => "cd /vagrant && make php"
##
# Create database (move this to cookbook level)
#
config.vm.provision :shell, :inline => "mysql -uroot -ppassword -e 'create database if not exists croogo'"
config.vm.provision :shell, :inline => "mysql -uroot -ppassword -e 'create database if not exists croogo_test'"
end