-
Notifications
You must be signed in to change notification settings - Fork 142
Deploy on Heroku
Geremia Taglialatela edited this page May 30, 2017
·
50 revisions
A fast guide on how to deploy icare on Heroku
Note: you will probably need to edit source code in order to customize icare according to your needs
- *nix based OS (we don't support Microsoft Windows)
- git version control system
- Heroku Toolbelt
- A working Facebook Application
- A valid Google Maps JavaScript API key
Replace appname
with a name of your choice.
- Setup a new application
heroku create appname --remote production
- Enable branch tracking
git config push.default tracking
- Add add-ons
heroku addons:create mongolab:sandbox # Database
heroku addons:create redistogo:nano # Background jobs
heroku addons:create newrelic # App monitoring
heroku addons:create papertrail # Log monitoring
- Setup environment variables
heroku config:add APP_BASE_URL=CHANGEME_WITH_YOUR_APPNAME.herokuapp.com
heroku config:add GOOGLE_MAPS_API_KEY=CHANGEME_WITH_YOUR_GOOGLE_MAPS_API_KEY
heroku config:add FACEBOOK_NAMESPACE=CHANGEME_WITH_YOUR_FACEBOOK_NAMESPACE
heroku config:add FACEBOOK_APP_ID=CHANGEME_WITH_YOUR_FACEBOOK_APP_ID
heroku config:add FACEBOOK_SECRET=CHANGEME_WITH_YOUR_FACEBOOK_SECRET
heroku config:add RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=1.3
heroku config:add DEVISE_SECRET_KEY="$(bundle exec rake secret)" DEVISE_PEPPER="$(bundle exec rake secret)"
- Setup Google Analytics, Airbrake and New Relic (optional)
heroku config:add GOOGLE_ANALYTICS_ID=UA-XXXXXXXX-X
heroku config:add AIRBRAKE_API_KEY=xxx
heroku config:add AIRBRAKE_HOST=xxx
- Push!
git checkout master
git push production master
- Create db indexes and populate db with some default objects
heroku run rake db:mongoid:create_indexes db:seed
- Set up to track remote branch production/master from master. In this way you can simply launch
git push
from master branch instead ofgit push production master
to deploy on Heroku
git branch master --set-upstream-to production/master
Replace appname
with the name of the existing application. We suppose you already have forked this repository.
- Add the
heroku
remote
heroku git:remote -a appname -r production
- Enable branch tracking
git config push.default tracking
- After pushing for the first time to production master, set up to track remote branch production/master from master
git branch master --set-upstream-to production/master
On free Heroku hosting, the "Share on Facebook Timeline" will use a background worker inside the web dyno, by using defunkt/unicorn and the following instructions from Diaspora