application "zmx_app" do
path "/srv/zmx"
owner 'nobody'
group 'nogroup'
repository '
:zmxmusic/zmx2.git'
deploy_key "-----BEGIN RSA PRIVATE KEY----- ...etc... -----END RSA PRIVATE KEY-----\n" # note embedded newlines
if node.chef_environment=='production'
revision '2.26'
action :deploy
else
revision 'master'
action :force_deploy
end
db = "zmx_#{node.chef_environment}"
rails do
gems ['bundler']
precompile_assets true
database do
reconnect true
encoding 'utf8'
username '...'
adapter 'mysql2'
password '...'
database db
end
database_master_role "zmx_database_master"
end
passenger_apache2 do
end
end
There might well be better ways to do it; I migrated up from the old cookbook. My apache/passenger config is really done in other recipes; one of these days I'll take care of that and probably migrate to unicorn, nginx, etc.
Don't know what you're using for database. I had to wrestle mightily with the mysql (and database?) cookbooks to get a working set of cookbooks+recipes that would come up from scratch on AWS... I'm not even convinced I've actually got that, yet, but needed to move on and get stuff done.
--
On Sat, Jul 21, 2012 at 1:09 PM, Wes Morgan
<
" target="_blank">
> wrote:
I'm trying to deploy a Rails app using the new application cookbook. According to the README, I'm supposed to declare a dependency on the application_rails cookbook in the metadata.rb, but that doesn't seem to exist. Earlier in the README, application_ruby is mentioned, so I switched it to that. Do we need a documentation fix there?
Anyway, I can't quite figure out how the rails-y portion of the cookbook is supposed to be invoked. Just declaring a "depends" line in metadata.rb doesn't actually run anything, does it?
I see in the examples that there is a rails do ... end block in the application's block. Is that what triggers it?
Does anyone have a working example of deploying a Rails app w/ the new application cookbook?
Wes