From a2c2d0f5de2047f116b8c4903f2d6889c7f06535 Mon Sep 17 00:00:00 2001 From: John Joseph Bachir Date: Mon, 20 May 2013 20:41:16 -0400 Subject: [PATCH 1/2] correct language for code block --- docs/HEROKU.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/HEROKU.md b/docs/HEROKU.md index 5b5b99994f..28609ef4ae 100644 --- a/docs/HEROKU.md +++ b/docs/HEROKU.md @@ -25,7 +25,7 @@ For details on how to reduce the monthly cost of your application, see [Advanced *.gitignore* - ```ruby + ```diff - config/redis.yml + # config/redis.yml ``` From 7ece1671597c487539a93d26d4c432beeb0491ee Mon Sep 17 00:00:00 2001 From: John Joseph Bachir Date: Mon, 20 May 2013 20:41:33 -0400 Subject: [PATCH 2/2] redis configurable via ENV Change heroku docs and tweak redis.yml.sample var name to accmodate setting redis provider url via configs. --- config/redis.yml.sample | 2 +- docs/HEROKU.md | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/config/redis.yml.sample b/config/redis.yml.sample index ac196c930f..796589989f 100644 --- a/config/redis.yml.sample +++ b/config/redis.yml.sample @@ -1,5 +1,5 @@ defaults: &defaults - uri: <%= uri = URI.parse(ENV['SET_REDIS_PROVIDER_URL'] || "redis://localhost:6379") %> + uri: <%= uri = URI.parse(ENV['REDIS_PROVIDER_URL'] || "redis://localhost:6379") %> host: <%= uri.host %> port: <%= uri.port %> password: <%= uri.password %> diff --git a/docs/HEROKU.md b/docs/HEROKU.md index 28609ef4ae..d5031e6682 100644 --- a/docs/HEROKU.md +++ b/docs/HEROKU.md @@ -12,14 +12,9 @@ For details on how to reduce the monthly cost of your application, see [Advanced cd discourse git checkout -b heroku -2. Modify the redis.yml file to use the environment variable provided by Heroku and the Redis provider of your choice. +2. Create a redis.yml file. - *config/redis.yml* - - ```erb - - uri: <%= uri = URI.parse(ENV['SET_REDIS_PROVIDER_URL'] || "redis://localhost:6379") %> - + uri: <%= uri = URI.parse(ENV['OPENREDIS_URL'] || "redis://localhost:6379") %> - ``` + cp config/redis.yml.sample config/redis.yml 3. Comment out or delete `config/redis.yml` from .gitignore. We want to include redis.yml when we push to Heroku. @@ -59,19 +54,24 @@ For details on how to reduce the monthly cost of your application, see [Advanced heroku addons:add openredis:micro -3. Add the [Heroku Scheduler](https://addons.heroku.com/scheduler) add-on, this saves us from running a separate clock process, reducing the cost of the app. +3. Point the app at your redis provider's URL + + heroku config:get OPENREDIS_URL + heroku config:set REDIS_PROVIDER_URL= + +4. Add the [Heroku Scheduler](https://addons.heroku.com/scheduler) add-on, this saves us from running a separate clock process, reducing the cost of the app. heroku addons:add scheduler:standard -4. Generate a secret token in the terminal. +5. Generate a secret token in the terminal. rake secret -5. Push the secret to the stored heroku environment variables, this will now be available to your app globally. +6. Push the secret to the stored heroku environment variables, this will now be available to your app globally. heroku config:add SECRET_TOKEN= -6. Precompile assets. +7. Precompile assets. There are two options for precompilation. Either precompile locally, **before each deploy** or enable [Heroku's experimental user-env-compile](https://devcenter.heroku.com/articles/labs-user-env-compile) feature and Heroku will precompile your assets for you. @@ -102,11 +102,11 @@ For details on how to reduce the monthly cost of your application, see [Advanced # Unset var unset SECRET_TOKEN -7. Push your heroku branch to Heroku. +8. Push your heroku branch to Heroku. git push heroku heroku:master -8. Migrate and seed the database. +9. Migrate and seed the database. heroku run rake db:migrate db:seed_fu