-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathVagrantfile
59 lines (54 loc) · 2 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure('2') do |config|
config.vm.box = 'hashicorp/precise64'
config.vm.box_url = 'https://atlas.hashicorp.com/hashicorp/boxes/precise64'
config.vm.network :forwarded_port, guest: 80, host: 11000 #nginx
config.vm.network :forwarded_port, guest: 8000, host: 11001 #apache
# config.vm.synced_folder './db', '/home/vagrant/drush-backups/'
# precise64.box doesn't have chef 11, which this cookbook requires
# precise64.box also uses Ruby 1.8.7 which breaks certain cookbooks
# using Ruby 1.9 specific syntax
config.vm.provision :shell, :inline => <<-HEREDOC
apt-get update -qqy
apt-get install -qqy ruby1.9.1 ruby1.9.1-dev build-essential
gem install bundler --no-rdoc --no-ri
BUNDLE_GEMFILE=/vagrant/Gemfile bundle install
# NOTE uncomment the following to use librarian-chef instead of vagrant-berkshelf
# apt-get install -y git && gem install librarian-chef
# cd /vagrant ; rm -f Cheffile.lock; librarian-chef install
HEREDOC
config.vm.provision :chef_solo do |chef|
chef.add_recipe 'deploy-drupal::default'
chef.add_recipe 'deploy-drupal::nginx'
chef.add_recipe 'minitest-handler'
chef.json.merge!({
'deploy-drupal' => {
'dev_group' => 'vagrant',
'apache_port' => '8000',
'writable_dirs' => [ "sites/default/files", "cache" ]
},
'apache' => {
'listen_ports' => ['8000'],
'default_site_enabled' => false,
},
'nginx' => {
'default_site_enabled' => false,
'gzip' => 'on',
},
'mysql' => {
'server_root_password' => 'root',
'server_debian_password' => 'root',
'server_repl_password' => 'root',
},
'memcached' => {
'listen' => '127.0.0.1'
},
'minitest' =>{
'recipes' => [ 'deploy-drupal::default' ] #, 'deploy-drupal::nginx', ],
}
})
# see https://github.com/mitchellh/vagrant/issues/4270
chef.custom_config_path = 'Vagrantfile.chef'
end
end