Heroku
How to create a staging environment
https://agilewarrior.wordpress.com/2014/05/16/how-to-create-a-staging-environment-heroku/
How to create a named app
https://agilewarrior.wordpress.com/2014/05/16/how-to-create-a-named-app-in-heroku/
How to setup staging and prod environments
Clone nutshell and add remotes.
$ git remote add staging https://git.heroku.com/nutshell-staging.git
$ git remote add prod https://git.heroku.com/hidden-ridge-8790.git
Make your changes and commit.
Then push remotely.
$ git push staging
$ git push prod
Database
Pull database locally
$ heroku pgbackups
$ heroku db:pull
Database backup/restore
$ heroku addons:add pgbackups
$ heroku pgbackups:capture
$ heroku pgbackups:restore DATABASE b002
$ heroku pgbackups:destroy b001
Reset database
$ git push heroku
$ heroku pg:reset DATABASE
$ heroku run rake db:migrate –remote staging
$ heroku run rake db:seed
$ heroku run rake db:populate
Migrations not working
$ heroku restart
$ heroku ps –app targetapp (list dynos)
$ heroku ps:restart web.1 –app targetapp
Setup automonth backups
$ heroku pgbackups
$ heroku addons:upgrade pgbackups:auto-month
SQL changes to prod
- Pull database local
$ heroku db:pull -
Make changes in prod.rake
-
Test and run locally
$ bundle exec rake db:updateprod -
Checkin.
-
Push to prod.
-
Run against prod
$ heroku run rake db:updateprod
Environment vars
$ heroku config:set S3_BUCKET=agilenutshell –app targetapp
$ heroku config –app hidden-ridge-8790
Loggin
$ heroku logs –tail –app hidden-ridge-8790
Routes
Adding/removing routes
$ git remote -v
$ git remote rm heroku
$ git remote add heroku get@heroku.com:takemystuff.git
Creating new route
If you have blown away your repo and you need to add your heroku remote instance back do this:
$ heroku create
$ git remote set-url heroku git@heroku.com:hidden-ridge-8790.git
This creates the heroku remote, and then points it to where you want
Pushing to heroku for first time
$ heroku create –stack cedar
$ git push heroku master
$ heroku run rake db:migrate
Mapping git remote back to an existing url
$ git remote add heroku git@heroku.com:hidden-ridge-8790.git
Misc commands
$ heroku run rake db:migrate (–app targetapp)
$ heroku logs (–app targetapp –tail)
$ heroku open
$ heroku run console
$ heroku domains:add academy.robotsandpencils.com
$ heroku info -a secret-waters-xxxx
Images not showing up
http://stackoverflow.com/questions/21974190/background-image-not-showing-up-in-heroku
Aug 02, 2013 @ 18:10:12