Permalink
Browse files

MS TT; Add heroku_san to gemfile, adjust custom heroku rake tasks

  • Loading branch information...
1 parent 66d71a2 commit 467f3b0bda6e062c9103c71dccc2b66f4dc699e3 @maxwell maxwell committed Jan 17, 2012
Showing with 30 additions and 17 deletions.
  1. +1 −0 .gitignore
  2. +1 −0 Gemfile
  3. +4 −0 Gemfile.lock
  4. +15 −0 config/heroku.yml.example
  5. +9 −17 lib/tasks/heroku.rake
View
@@ -7,6 +7,7 @@ public/images/ball.png
config/app_config.yml
config/app.yml
config/application.yml
+config/heroku.yml
config/script_server*.yml
config/fb_config.yml
config/oauth_keys.yml
View
@@ -139,6 +139,7 @@ end
group :development do
gem 'heroku'
+ gem 'heroku_san'
gem 'capistrano', '~> 2.9.0', :require => false
gem 'capistrano_colors', :require => false
gem 'capistrano-ext', '1.2.1', :require => false
View
@@ -194,6 +194,9 @@ GEM
rest-client (~> 1.6.1)
rubyzip
term-ansicolor (~> 1.0.5)
+ heroku_san (1.3.0)
+ heroku (>= 2)
+ rails (>= 2)
highline (1.6.9)
hoptoad_notifier (2.4.11)
activesupport
@@ -442,6 +445,7 @@ DEPENDENCIES
fuubar (= 0.0.6)
haml
heroku
+ heroku_san
hoptoad_notifier
http_accept_language!
i18n-inflector-rails (~> 1.0)
View
@@ -0,0 +1,15 @@
+defaults: &defaults
+ HEROKU: true
+ application_yml: <%= '../' + '../' +'config/' + 'application.yml.example' %>
+production:
+ app: production
+ stack: cedar
+ config:
+ <<: *defaults
+ BUNDLE_WITHOUT: "development:test"
+staging:
+ app: staging
+ stack: cedar
+ config:
+ <<: *defaults
+ BUNDLE_WITHOUT: "development:test"
View
@@ -1,26 +1,18 @@
-# Copyright (c) 2012, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
-#
+ #Copyright (c) 2012, Diaspora Inc. This file is
+ #licensed under the Affero General Public License version 3 or later. See
+ #the COPYRIGHT file.
+
require File.join(Rails.root, 'lib', 'enviroment_configuration')
namespace :heroku do
- HEROKU_CONFIG_ADD_COMMAND = "heroku config:add HEROKU=true"
-
- task :config do
- puts "Reading config/application.yml and sending config vars to Heroku..."
- application_config = YAML.load_file('config/application.yml')['production'] rescue {}
- application_config.delete_if { |k, v| v.nil? or v.to_s.empty? }
-
- #heroku_env = application_config.map do|key, value|
- #value =value.join(EnviromentConfiguration::ARRAY_SEPERATOR) if value.respond_to?(:join)
-
- #"#{key}=\"#{value}\""
- #end.join(' ')
+ HEROKU_CONFIG_ADD_COMMAND = "heroku config:add"
+ task :generate_secret_token do
puts "Generating and setting a new secret token"
token = ActiveSupport::SecureRandom.hex(40)#reloads secret token every time you reload vars.... this expires cookies, and kinda sucks
- system "#{HEROKU_CONFIG_ADD_COMMAND} HEROKU=true SECRET_TOKEN=#{token}"
+ command = "#{HEROKU_CONFIG_ADD_COMMAND} SECRET_TOKEN=#{token}"
+ puts command
+ system command
end
task :install_requirements do

0 comments on commit 467f3b0

Please sign in to comment.