Commit 330f252f by David Ormsbee

Convert to Heroku config

parent 432a62d9
......@@ -48,3 +48,4 @@ group :test do
gem 'rack-test', :require => "rack/test"
end
gem 'newrelic_rpm'
......@@ -99,6 +99,7 @@ GEM
tzinfo (~> 0.3.22)
moped (1.2.0)
multi_json (1.3.6)
newrelic_rpm (3.4.1)
nokogiri (1.5.5)
origin (1.0.6)
pry (0.9.10)
......@@ -166,6 +167,7 @@ DEPENDENCIES
mongoid_magic_counter_cache!
mongoid_taggable_with_context!
moped
newrelic_rpm
nokogiri
pry
pry-nav
......
......@@ -4,6 +4,10 @@ require 'bundler'
Bundler.setup
Bundler.require
Tire.configure do
url YAML.load_file("config/application.yml")['elasticsearch_server']
end
desc "Load the environment"
task :environment do
environment = ENV["SINATRA_ENV"] || "development"
......
require 'rubygems'
require 'bundler'
require 'erb'
Bundler.setup
Bundler.require
......@@ -17,9 +18,14 @@ module CommentService
API_PREFIX = "/api/#{API_VERSION}"
end
if environment == "staging" or environment == "production"
require 'newrelic_rpm'
end
set :cache, Dalli::Client.new
CommentService.config = YAML.load_file("config/application.yml").with_indifferent_access
application_yaml = ERB.new(File.read("config/application.yml")).result()
CommentService.config = YAML.load(application_yaml).with_indifferent_access
Tire.configure do
url CommentService.config[:elasticsearch_server]
......
level_limit: 3
cache_enabled: false
api_key: "PUT_YOUR_API_KEY_HERE"
elasticsearch_server: "http://localhost:9200"
api_key: <%= ENV['API_KEY'] || 'PUT_YOUR_API_KEY_HERE' %>
elasticsearch_server: <%= ENV['SEARCH_SERVER'] || 'http://localhost:9200' %>
cache_timeout:
threads_search: 10
threads_query: 10
......@@ -12,23 +12,20 @@ test:
hosts:
- localhost:27017
staging2:
production:
sessions:
default:
database: cs_comments_service_staging
hosts:
- alex.mongohq.com:10079
username: forum
password: forum
uri: <%= ENV['MONGOHQ_URL'] %>
staging:
sessions:
default:
database: cs_comments_service_staging
hosts:
- ds037047.mongolab.com:37047
username: forum
password: forum
uri: <%= ENV['MONGOHQ_URL'] %>
loadtest:
sessions:
default:
uri: <%= ENV['MONGOHQ_URL'] %>
defaults: &defaults
use_utc: false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment