Commit 467f3b0b authored by Maxwell Salzberg's avatar Maxwell Salzberg
Browse files

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

parent 66d71a21
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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
+1 −0
Original line number Diff line number Diff line
@@ -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
+4 −0
Original line number Diff line number Diff line
@@ -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)
+15 −0
Original line number Diff line number Diff line
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"
+9 −17
Original line number Diff line number Diff line
 #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