MS TT; Add heroku_san to gemfile, adjust custom heroku rake tasks
This commit is contained in:
parent
66d71a217e
commit
467f3b0bda
5 changed files with 30 additions and 17 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -7,6 +7,7 @@ public/images/ball.png
|
||||||
config/app_config.yml
|
config/app_config.yml
|
||||||
config/app.yml
|
config/app.yml
|
||||||
config/application.yml
|
config/application.yml
|
||||||
|
config/heroku.yml
|
||||||
config/script_server*.yml
|
config/script_server*.yml
|
||||||
config/fb_config.yml
|
config/fb_config.yml
|
||||||
config/oauth_keys.yml
|
config/oauth_keys.yml
|
||||||
|
|
|
||||||
1
Gemfile
1
Gemfile
|
|
@ -139,6 +139,7 @@ end
|
||||||
|
|
||||||
group :development do
|
group :development do
|
||||||
gem 'heroku'
|
gem 'heroku'
|
||||||
|
gem 'heroku_san'
|
||||||
gem 'capistrano', '~> 2.9.0', :require => false
|
gem 'capistrano', '~> 2.9.0', :require => false
|
||||||
gem 'capistrano_colors', :require => false
|
gem 'capistrano_colors', :require => false
|
||||||
gem 'capistrano-ext', '1.2.1', :require => false
|
gem 'capistrano-ext', '1.2.1', :require => false
|
||||||
|
|
|
||||||
|
|
@ -194,6 +194,9 @@ GEM
|
||||||
rest-client (~> 1.6.1)
|
rest-client (~> 1.6.1)
|
||||||
rubyzip
|
rubyzip
|
||||||
term-ansicolor (~> 1.0.5)
|
term-ansicolor (~> 1.0.5)
|
||||||
|
heroku_san (1.3.0)
|
||||||
|
heroku (>= 2)
|
||||||
|
rails (>= 2)
|
||||||
highline (1.6.9)
|
highline (1.6.9)
|
||||||
hoptoad_notifier (2.4.11)
|
hoptoad_notifier (2.4.11)
|
||||||
activesupport
|
activesupport
|
||||||
|
|
@ -442,6 +445,7 @@ DEPENDENCIES
|
||||||
fuubar (= 0.0.6)
|
fuubar (= 0.0.6)
|
||||||
haml
|
haml
|
||||||
heroku
|
heroku
|
||||||
|
heroku_san
|
||||||
hoptoad_notifier
|
hoptoad_notifier
|
||||||
http_accept_language!
|
http_accept_language!
|
||||||
i18n-inflector-rails (~> 1.0)
|
i18n-inflector-rails (~> 1.0)
|
||||||
|
|
|
||||||
15
config/heroku.yml.example
Normal file
15
config/heroku.yml.example
Normal file
|
|
@ -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"
|
||||||
|
|
@ -1,26 +1,18 @@
|
||||||
# Copyright (c) 2012, Diaspora Inc. This file is
|
#Copyright (c) 2012, Diaspora Inc. This file is
|
||||||
# licensed under the Affero General Public License version 3 or later. See
|
#licensed under the Affero General Public License version 3 or later. See
|
||||||
# the COPYRIGHT file.
|
#the COPYRIGHT file.
|
||||||
#
|
|
||||||
require File.join(Rails.root, 'lib', 'enviroment_configuration')
|
require File.join(Rails.root, 'lib', 'enviroment_configuration')
|
||||||
|
|
||||||
namespace :heroku do
|
namespace :heroku do
|
||||||
HEROKU_CONFIG_ADD_COMMAND = "heroku config:add HEROKU=true"
|
HEROKU_CONFIG_ADD_COMMAND = "heroku config:add"
|
||||||
|
|
||||||
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(' ')
|
|
||||||
|
|
||||||
|
task :generate_secret_token do
|
||||||
puts "Generating and setting a new secret token"
|
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
|
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
|
end
|
||||||
|
|
||||||
task :install_requirements do
|
task :install_requirements do
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue