-
-
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 |
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).
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?
How would you then run redmine specific tasks eg: generate_secret_token - using a callback like before_restart? What about other things like installing themes or plugins (say from folders in files)?
Also, I'm trying to use unicorn with nginx via a socket instead - do you have any examples doing it that way?