Created
June 15, 2011 22:03
-
-
Save threetee/1028250 to your computer and use it in GitHub Desktop.
chef nginx_unicorn recipe (part of modified application cookbook)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app = node.run_state[:current_app] | |
#unicorn | |
include_recipe "application::unicorn" | |
#nginx | |
include_recipe "nginx::source" | |
#nginx/unicorn proxy | |
socket = "/tmp/unicorn_#{app['id']}.sock" | |
template "#{node[:nginx][:dir]}/sites-available/#{app['id']}" do | |
source "unicorn_nginx_site.erb" | |
owner "root" | |
group "root" | |
cookbook "#{app['id']}" | |
mode 0644 | |
variables( | |
:docroot => File.join(app['deploy_to'], 'current', 'public'), | |
:socket => socket, | |
:opts => app['nginx'], | |
:server_domain => app['server_domain'][node.app_environment], | |
) | |
notifies :restart, resources(:service => "nginx") | |
end | |
nginx_site app['id'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment