-
Notifications
You must be signed in to change notification settings - Fork 5
/
Vagrantfile
83 lines (80 loc) · 2.93 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define :develop do |develop|
develop.omnibus.chef_version = :latest
develop.vm.hostname = "develop"
develop.vm.box = "opscode-ubuntu-14.04"
develop.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-14.04_chef-provisionerless.box"
develop.vm.network :private_network, ip: "192.168.33.33"
develop.vm.network "forwarded_port", guest: 80, host: 8888
develop.vm.provider "virtualbox" do |vb|
vb.gui = true
# vb.memory = "1024"
end
# 以下を追加
# Vagrantfileがあるディレクトリと同じディレクトリのapplicationディレクトリをVagrantと共有します
# 先にapplicationディレクトリを作成しておいてください。
develop.vm.synced_folder "application", "/var/www/application/current",
id: "vagrant-root", :nfs => false,
:owner => "vagrant",
:group => "www-data",
:mount_options => ["dmode=775,fmode=775"]
# 追加ここまで
# 以下のプロビジョニングの設定を追加
develop.vm.provision :chef_solo do |chef|
chef.log_level = "debug"
chef.cookbooks_path = "./cookbooks"
chef.json = {
nginx: {
docroot: {
owner: "vagrant",
group: "vagrant",
path: "/var/www/application/current/app/webroot",
force_create: true
},
default: {
fastcgi_params: { OSS_CAKE_ENV: "development" }
},
test: {
available: true,
fastcgi_params: { OSS_CAKE_ENV: "test" }
}
},
mysql: {
accept_connection_from_outside: true,
app_database_name: "openslideshare",
app_database_user: "webapp",
app_database_password: "passw0rd"
},
appenv: {
OSS_RDS_HOSTNAME: "localhost",
OSS_RDS_USERNAME: "webapp",
OSS_RDS_PASSWORD: "passw0rd",
OSS_RDS_DB_NAME: "openslideshare",
OSS_AWS_ACCESS_ID: ENV['OSS_AWS_ACCESS_ID'],
OSS_AWS_SECRET_KEY: ENV['OSS_AWS_SECRET_KEY'],
OSS_BUCKET_NAME: ENV['OSS_BUCKET_NAME'],
OSS_IMAGE_BUCKET_NAME: ENV['OSS_IMAGE_BUCKET_NAME'],
OSS_USE_S3_STATIC_HOSTING: ENV['OSS_USE_S3_STATIC_HOSTING'],
OSS_CDN_BASE_URL: ENV['OSS_CDN_BASE_URL'],
OSS_REGION: ENV['OSS_REGION'],
OSS_SQS_URL: ENV['OSS_SQS_URL'],
OSS_DEBUG: "2",
OSS_BATCH_USER: "vagrant"
}
}
chef.run_list = %w[
recipe[apt]
recipe[phpenv::default]
recipe[phpenv::composer]
recipe[phpenv::develop]
recipe[appenv::default]
recipe[appenv::worker]
recipe[devtool::default]
]
end
end
end