-
-
Save jtimberman/2784164 to your computer and use it in GitHub Desktop.
application "redmine" do | |
path "/opt/redmine" | |
owner "nobody" | |
group "nogroup" | |
repository "git://github.com/redmine/redmine.git" | |
revision "2.0-stable" | |
packages ["build-essential", | |
"git", | |
"postgresql-server-dev-all", | |
"libgraphicsmagick++-dev", | |
"libmagick++-dev", | |
"libmagick-dev", | |
"libmagickwand-dev", | |
"libsqlite3-dev"] | |
rails do | |
gems ["bundler","passenger"] | |
database do | |
database "redmine" | |
username "redmine" | |
password "awesome_password" | |
end | |
database_master_role "redmine_database_master" | |
end | |
passenger_apache2 do | |
server_aliases ["redmine", "redmine.#{node['domain']}"] | |
end | |
end |
Ok thanks. I found some better docs on the callbacks under the Deploy resource http://wiki.opscode.com/display/chef/Deploy+Resource - this probably should be referenced in the Application cookbook. I'll probably use before_restart or similar.
The other thing I want to do is override the unicorn and runit templates (to implement the structure used by github https://github.com/blog/517-unicorn). Ideally, I could still use the unicorn block as normal. I'm kind of new to Chef but can I just place sv-unicorn-run.erb (for the application_ruby unicorn resource) and unicorn.rb.erb (for the unicorn cookbook) within redmine/templates/defaults or do the underlying templates need a "cookbook" parameter in which case they would need modifications?
Those kinds of things would likely be other resources in the recipe where this one is used, assuming they don't need to happen at the same time the code is deployed and set up (and they could trigger a restart of the web server, passenger / apache2 in this case).