|
Re: Different configuration for dev/test/prod: msg#00129lang.ruby.capistrano.general
On Dec 19, 7:29 am, Gregory Seidman <gsslist +capistr...-dNXPQ6k9rNiG6BJUYyje5axOck334EZe@xxxxxxxxxxxxxxxx> wrote: > I'm trying to figure out the best approach to having different > configurations for when I'm deploying to a development machine (just a > single mongrel running from a directory in my home directory), a production > machine (service script via sudo to start mongrel cluster, deployed to a > directory under /var/www, maybe multiple machines), or a test machine (same > as prod, but a different machine). > > I don't think roles are the right approach. I could have different config > files and load the right file based on a -S variable or with a -F flag, but > that's kind of ugly. > > What I'd like is to have a dev, test, and prod namespace in which all of > the deploy namespace is included, with overrides as necessary. Then I'd cap > dev:deploy or cap test:deploy:restart or the like. Is there a way to import > one namespace into another? > > --Greg I have staging environment, not development, but same should work: task :staging do role :app, 'dev.machine' role :db, 'dev.machine' set :mongrel_port, '3000' set :mongrel_ip, '0.0.0.0' set :rails_env, 'staging' common_stuff end task :production do role :app, 'production.app.machine' role :db, 'production.db.machine' set :mongrel_port, '9000' set :mongrel_ip, '127.0.0.1' set :rails_env, 'production' common_stuff end task :common_stuff do namespace :deploy do task :start, :roles => :app do run "mongrel_rails start -d -p #{ mongrel_port } -a #{ mongrel_ip } -e #{ rails_env }" end # ... end end Run like: $ cap production deploy:start $ cap staging deploy:restart $ etc |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: git + deploy:pending == not working right?: 00129, Joe Van Dyk |
|---|---|
| Next by Date: | Re: Problem with a new role: 00129, alexander.graefe-gM/Ye1E23mwN+BqQ9rBEUg@xxxxxxxxxxxxxxxx |
| Previous by Thread: | Different configuration for dev/test/prodi: 00129, Gregory Seidman |
| Next by Thread: | Re: Different configuration for dev/test/prod: 00129, Gregory Seidman |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |