chovy
June 27, 2008, 8:12pm
1
How do I avoid adding:
export RAILS_ENV=‘production’
How do I avoid setting my environment globally as production?
I have two sites on the same server:
/www/stage.example.com
/www/test.excample.com
Both apps are using the same database after deployment, I’d like them
not to be shared.
–
Anthony E.
408-656-2473
http://anthony.ettinger.name
chovy
June 27, 2008, 11:18pm
2
Well, assuming that you don’t have the database.yml in your SCM (which
you shouldn’t)… you should be able to just set the production db to
the different database for each one.
Robby
On Fri, Jun 27, 2008 at 11:11 AM, Anthony E. [email protected]
wrote:
–
Robby R.
Chief Evangelist, Partner
PLANET ARGON, LLC
design // development // hosting
Planet Argon is a Ruby on Rails development agency specializing in maintenance and support for existing Rails apps. Based in Portland, OR, Planet Argon has been a member of the Rails community since 2004.
http://www.robbyonrails.com/
aim: planetargon
+1 503 445 2457
+1 877 55 ARGON [toll free]
+1 815 642 4068 [fax]
chovy
June 29, 2008, 1:35pm
3
If you are like me, using capistrano,
add those lines below to deploy.rb:
task “stage.example.com ” do
set :target, current_task.name
end
task “test.example.com ” do
set :target, current_task.name
end
task :replace_configs do
run “(cd #{release_path}; cp config/deploy/#{target}/database.yml
config)”
end
before “deploy:finalize_update”, :replace_configs
place database.yml for each target
config/deploy/stage.example.com/database.yml
and
config/deploy/test.example.com/database.yml
then, you can deploy each target
$ cap stage.example.com deploy
or
$ cap test.example.com deploy
A recipe “Run Multi-Stage Deployments” in the book “Advanced Rails
Recipes” describes such one
http://pragprog.com/titles/fr_arr/advanced-rails-recipes
chovy
June 30, 2008, 9:03pm
4
Your production/staging servers should have a database.yml file that
you symlink to during the deploy process.
Robby
On Fri, Jun 27, 2008 at 5:20 PM, Anthony E. [email protected]
wrote:
the different database for each one.
I have two sites on the same server:
408-656-2473
–
Robby R.
Chief Evangelist, Partner
PLANET ARGON, LLC
design // development // hosting
Planet Argon is a Ruby on Rails development agency specializing in maintenance and support for existing Rails apps. Based in Portland, OR, Planet Argon has been a member of the Rails community since 2004.
http://www.robbyonrails.com/
aim: planetargon
+1 503 445 2457
+1 877 55 ARGON [toll free]
+1 815 642 4068 [fax]
chovy
June 28, 2008, 2:21am
5
I currently do push the database.yml file, how should I do it without
having that file on the server?
On Fri, Jun 27, 2008 at 2:17 PM, Robby R. [email protected]
wrote:
export RAILS_ENV=‘production’
+1 503 445 2457
+1 877 55 ARGON [toll free]
+1 815 642 4068 [fax]
–
Anthony E.
408-656-2473
http://anthony.ettinger.name