Permalink
Switch branches/tags
Nothing to show
Find file Copy path
0e78692 Jan 14, 2014
2 contributors

Users who have contributed to this file

@timtoyoshima @jeremeamia
37 lines (31 sloc) 928 Bytes
node[:deploy].each do |app_name, deploy|
script "install_composer" do
interpreter "bash"
user "root"
cwd "#{deploy[:deploy_to]}/current"
code <<-EOH
curl -sS https://getcomposer.org/installer | php
php composer.phar install --no-dev
EOH
end
template "#{deploy[:deploy_to]}/current/db-connect.php" do
source "db-connect.php.erb"
mode 0660
group deploy[:group]
if platform?("ubuntu")
owner "www-data"
elsif platform?("amazon")
owner "apache"
end
variables(
:host => (deploy[:database][:host] rescue nil),
:user => (deploy[:database][:username] rescue nil),
:password => (deploy[:database][:password] rescue nil),
:db => (deploy[:database][:database] rescue nil),
:table => (node[:phpapp][:dbtable] rescue nil)
)
only_if do
File.directory?("#{deploy[:deploy_to]}/current")
end
end
end