From ba63c028e6453dd2d45cdad398ecbbf4dea6682d Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Tue, 30 Aug 2011 11:39:42 -0700 Subject: [PATCH] added heroku gem, slugignore, and heroku rake task to load application.yml vars as config vars --- .slugignore | 2 ++ Gemfile | 1 + Gemfile.lock | 6 ++++++ lib/tasks/heroku.rake | 9 +++++++++ 4 files changed, 18 insertions(+) create mode 100644 .slugignore create mode 100644 lib/tasks/heroku.rake diff --git a/.slugignore b/.slugignore new file mode 100644 index 000000000..6d68cf7fe --- /dev/null +++ b/.slugignore @@ -0,0 +1,2 @@ +features +spec diff --git a/Gemfile b/Gemfile index 80c1f53b3..04031070e 100644 --- a/Gemfile +++ b/Gemfile @@ -4,6 +4,7 @@ gem 'rails', '3.0.10' gem 'bundler', '>= 1.0.0' gem 'foreman' +gem 'heroku' gem 'thin', '1.2.11', :require => false diff --git a/Gemfile.lock b/Gemfile.lock index 5428faa43..493fcc31e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -209,6 +209,11 @@ GEM json (>= 1.4.6) haml (3.1.2) hashie (1.0.0) + heroku (2.6.1) + launchy (>= 0.3.2) + rest-client (~> 1.6.1) + rubyzip + term-ansicolor (~> 1.0.5) highline (1.6.2) hoptoad_notifier (2.4.11) activesupport @@ -493,6 +498,7 @@ DEPENDENCIES foreman fuubar haml (= 3.1.2) + heroku hoptoad_notifier http_accept_language! i18n-inflector-rails (~> 1.0) diff --git a/lib/tasks/heroku.rake b/lib/tasks/heroku.rake new file mode 100644 index 000000000..9abe40533 --- /dev/null +++ b/lib/tasks/heroku.rake @@ -0,0 +1,9 @@ +namespace :heroku do + task :config do + puts "Reading config/application.yml and sending config vars to Heroku..." + CONFIG = YAML.load_file('config/application.yml')['production'] rescue {} + command = "heroku config:add" + CONFIG.each {|key, val| command << " #{key}=#{val} " if val } + system command + end +end