From 57079ef5cd5de1a01707a58b82a129adb13b6418 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Tue, 30 Aug 2011 14:38:21 -0700 Subject: [PATCH] set ENV['HEROKU'] explicitly in the heroku:config task --- app/models/app_config.rb | 6 +++--- lib/tasks/heroku.rake | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/models/app_config.rb b/app/models/app_config.rb index cbb53fbd4..ba3afc2d4 100644 --- a/app/models/app_config.rb +++ b/app/models/app_config.rb @@ -6,7 +6,7 @@ require 'uri' class AppConfig < Settingslogic def self.source_file_name - return ENV.to_hash if ENV["STACK"] # Using Heroku + return ENV.to_hash if ENV["HEROKU"] # Using Heroku if Rails.env == 'test' || ENV["CI"] || Rails.env.include?("integration") File.join(Rails.root, "config", "application.yml.example") @@ -18,7 +18,7 @@ class AppConfig < Settingslogic namespace Rails.env def self.load! - unless ENV["STACK"] + unless ENV["HEROKU"] if no_config_file? && !have_old_config_file? $stderr.puts <<-HELP ******** You haven't set up your Diaspora settings file. ********** @@ -54,7 +54,7 @@ Please do the following: Process.exit(1) end - if !ENV["STACK"] && no_cert_file_in_prod? + if !ENV["HEROKU"] && no_cert_file_in_prod? $stderr.puts <<-HELP ******** Diaspora does not know where your SSL-CA-Certificates file is. ********** Please add the root certificate bundle (this is operating system specific) to application.yml. Defaults: diff --git a/lib/tasks/heroku.rake b/lib/tasks/heroku.rake index 9abe40533..741b456cd 100644 --- a/lib/tasks/heroku.rake +++ b/lib/tasks/heroku.rake @@ -4,6 +4,7 @@ namespace :heroku do CONFIG = YAML.load_file('config/application.yml')['production'] rescue {} command = "heroku config:add" CONFIG.each {|key, val| command << " #{key}=#{val} " if val } + command << " HEROKU=true " system command end end