OK, here's some thoughts leading up to what I'm probably going
to do...

1. APP_ROOT/config.ru is in a pretty standardized location, good.

2. Most config.ru files out there (probably) don't contain
   environment-specific logic.  That is, developers on their
   desktop/laptops and the production app in datacenters can
   share the same config.ru without much difficulty.

   Can somebody please confirm this assumption?

Yeah i think APP_ROOT/config.ru is the standard here. Passenger uses it and its easy to use form rackup. heroku and ey-solo both look for config.ru in the approot.



3. Unicorn-specific config options should only be needed for
   server deployments.  Things for the typical developer
   on their workstation should "just work", like running
   "script/server" and "mongrel_rails" in RAILS_ROOT does
   for old Rails apps.

Yeah I think this is a better idea then my suggestion.



This leads me to keeping the Unicorn config file separate for production
environments.  My personal experience (with old Rails apps) is that
there are multiple "production"-like environments (staging, QA,
different datacenters)...

I'd imagine some apps I support will end up with config file
layouts looking like this:

APP_ROOT/config/unicorn/prod_lax.rb
APP_ROOT/config/unicorn/prod_dfw.rb
APP_ROOT/config/unicorn/prod_nyc.rb
APP_ROOT/config/unicorn/prod_chi.rb
APP_ROOT/config/unicorn/qa.rb
APP_ROOT/config/unicorn/staging.rb
APP_ROOT/config/unicorn/demo.rb
APP_ROOT/config.ru

Thus to deploy to our Los Angeles datacenter, the script
would just run:

 unicorn -c APP_ROOT/config/unicorn/prod_lax.rb

If there's an APP_ROOT/config_prod.ru needed, then
the APP_ROOT/config/prod_*.rb files would each
be able to specify APP_ROOT/config_prod.ru instead
of APP_ROOT/config.ru.

That is, the Unicorn config file can specify an alternate
config.ru, but config.ru cannot specify a different
Unicorn config file.

Am I making sense? (it's been a long week for me so far...)

I think you've nailed it here.

Cheers-
Ezra


_______________________________________________
Mongrel-development mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/mongrel-development

Reply via email to