Now everything is easier. Here's how you do it ...
Create an app for every environment.
$ heroku create myapp --remote production $ heroku create myapp-staging --remote staging
This will create named remote repositories for each application, which you can see in .git/config .
Now you can use either - the application or - remote switches to target a specific application:
$ heroku info --app myapp-staging $ heroku info --remote staging
Install Rails Environments
For Rails applications, Heroku uses a production environment by default . If you want your middleware to run in the middleware, create an environment in your project and set the appropriate RAILS_ENV and RAKE_ENV environment variables in the application:
$ heroku config:set RACK_ENV=staging RAILS_ENV=staging --remote staging
Customize environments
If you have other configuration variables, you need to pass them to each environment as well.
$ heroku config:set AWS_KEY=abc --remote staging $ heroku config:set AWD_SECRET=123 --remote staging ...etc
This is a huge pain, although I just use my snappconfig stone and run
$ rake heroku:config:load[myapp-staging]
to load the YAML project configuration files into Heroku.
Deploy
Now you just click on Heroku as follows:
$ git push staging master $ git push production master
and migrate as follows:
$ heroku run rake db:migrate --remote staging $ heroku run rake db:migrate --remote production
(See Managing Multiple Environments for the Application. Heroku Dev Center for more information and shortcuts.)
Yarin Sep 27 '13 at 13:46 2013-09-27 13:46
source share