Capistrano and mongrel_cluster.yml

Hey everyone! Hope you guys are all doing good.

I was wondering how anyone here might be handling their
mongrel_cluster.yml file with capistrano on multiple environments. I
have my team, 3 of us with our own local development environment, a test
webserver with nginx/5mongrels and a pack of live servers with
nginx/12mongrels each. I haven’t finished my capistrano recipe yet but
it looks to me like when I deploy it’s going to overwrite all my
mongrel_cluster.yml files on every machine, both test and production,
with the same file. That would make things screwy. I want all the
production servers to get the same yml file but the test one should be
different.

Thoughts?

Raul

production servers to get the same yml file but the test one should be
different.

Thoughts?

You could do something like this…

desc “Link in the production database.yml”
task :after_update_code, :roles => :app do
run “cp #{release_path}/config/database.yml-production
#{release_path}/config/database.yml”
end

Just alter the filenames to match your mongrel.yml’s instead of
database.yml’s…

-philip

Hi Raul,

If you run:
svn propset svn:ignore mongrel_cluster.yml

Then mongrel_cluster.yml will no longer be checked in/out.

  • Mike

If you run:
svn propset svn:ignore mongrel_cluster.yml

Then mongrel_cluster.yml will no longer be checked in/out.

Just be sure you setup an after_deploy task to write it out from a
tracked
copy otherwise you’ll lose it the first time you deploy and wonder why
you’re site won’t work…

How do I know this? Uh… heh. :slight_smile:

OK that’s a great suggestion. Funny thing is, it seems simple in
retrospect! haha

Raul

----- Original Message -----
From: “Mike Sax” [email protected]
To: [email protected]
Sent: Friday, March 23, 2007 10:04 AM
Subject: [Rails-deploy] Re: capistrano and mongrel_cluster.yml