Guest User

Untitled

a guest
Aug 25th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. ### Deploying to Heroku
  2.  
  3. 1. Deploy the app to heroku following heroku normal instructions (add link to heroku help)
  4.  
  5. 1. Set heroku environment variables
  6.  
  7. Make sure all the options in `config.yml` are properly set then run:
  8.  
  9. bundle exec rake heroku:config
  10.  
  11. Copy, paste and run the generated command
  12.  
  13. 1. Remove postgres addon
  14.  
  15. heroku addons:destroy heroku-postgresql
  16.  
  17. 1. Addons: MemCachier (free) and SSL ($20)
  18.  
  19. heroku addon:create memcachier:dev
  20. heroku addons:create ssl:endpoint
  21.  
  22. 1. Addons: New Relic
  23.  
  24. heroku addon:create newrelic:wayne
  25.  
  26. Open the addon by running
  27.  
  28. heroku addon:open newrelic
  29.  
  30. Click on the top-right dropdown menu and select "Account Settings". On your account page, copy your License key.
  31. Open `config/newrelic.yml` to set `license_key` variable value to your license.
  32.  
  33.  
  34. 1. Addon: Flying Sphinx ($55)
  35.  
  36. heroku addons:create flying_sphinx:ceramic
  37.  
  38. > Ceramic plan is needed for Delta indexes. If you can manage without Delta Indexing, smaller plan is also ok
  39.  
  40.  
  41. 1. Addon: MySQL
  42.  
  43. heroku addon:create cleardb:ignite
  44.  
  45. Now get your database url by running
  46.  
  47. heroku config:get CLEARDB_DATABASE_URL
  48.  
  49. Copy the value of CLEARDB_DATABASE_URL returned **and CHANGE the adapter** from `mysql://` to `mysql2://` (there's a **2** there).
  50. Then set the value of DATABASE_URL environment variable.
  51.  
  52. heroku config:add DATABASE_URL='mysql2://{the rest of your connection string}'
  53.  
  54. And initialize your database
  55.  
  56. heroku run bundle exec rake db:schema:load
  57.  
  58. 1. Addon: Heroku scheduler
  59.  
  60. heroku addon:create scheduler:standard
  61.  
  62. Open the scheduler
  63.  
  64. heroku addon:open scheduler
  65.  
  66. And add the following jobs
  67.  
  68. | Job | Frequency |
  69. |----------------------------------------------------------|:---------:|
  70. | flying-sphinx index | hourly |
  71. | rails runner "CommunityMailer.deliver_community_updates" | Daily |
  72. | rake sharetribe:delete_expired_auth_tokens | Daily |
  73.  
  74.  
  75. #### Recomended dyno sizes
  76.  
  77. - **web:** Standard-2X
  78. - **worker:** Standard-2X
Add Comment
Please, Sign In to add comment