From d070a629b516e1430d465fc00fe89ebc74a5b07f Mon Sep 17 00:00:00 2001 From: Abdelkader Boudih Date: Fri, 25 Jul 2014 04:48:23 +0000 Subject: [PATCH 1/2] [Addon] Add deploy hooks for heroku. --- lib/tasks/_prepend/deploy.rake | 17 +++++++++++++++++ lib/tasks/humans.rake | 10 +++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 lib/tasks/_prepend/deploy.rake diff --git a/lib/tasks/_prepend/deploy.rake b/lib/tasks/_prepend/deploy.rake new file mode 100644 index 00000000..5b6d176f --- /dev/null +++ b/lib/tasks/_prepend/deploy.rake @@ -0,0 +1,17 @@ +# List of environments and their heroku git remotes +ENVIRONMENTS = { + staging: 'coderwall-staging', + production: 'coderwall-production' +} +namespace :deploy do + ENVIRONMENTS.keys.each do |env| + desc "Deploy to #{env}" + task env do + Rake::Task['deploy:after_deploy'].invoke + end + end + + task :after_deploy do |t, args| + Rake::Task['humans'].invoke + end +end \ No newline at end of file diff --git a/lib/tasks/humans.rake b/lib/tasks/humans.rake index b78a106e..d76c0d8c 100644 --- a/lib/tasks/humans.rake +++ b/lib/tasks/humans.rake @@ -1,7 +1,11 @@ task :humans do - erb = ERB.new(File.read(Rails.root.join('lib', 'templates', 'erb', 'humans.txt.erb')), nil, '-') + begin + erb = ERB.new(File.read(Rails.root.join('lib', 'templates', 'erb', 'humans.txt.erb')), nil, '-') - File.open(Rails.root.join('public', 'humans.txt'), 'w') do |file| - file.write(erb.result) + File.open(Rails.root.join('public', 'humans.txt'), 'w') do |file| + file.write(erb.result) + end + rescue => e + puts "Rake task humans failed: #{e}" end end \ No newline at end of file From 2f9ebc19267d5169e7d4a21097001419fa1f8d17 Mon Sep 17 00:00:00 2001 From: Abdelkader Boudih Date: Fri, 25 Jul 2014 04:49:52 +0000 Subject: [PATCH 2/2] [fix] move jquery.coderwall.js to public --- {app/assets => public}/javascripts/jquery.coderwall.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {app/assets => public}/javascripts/jquery.coderwall.js (100%) diff --git a/app/assets/javascripts/jquery.coderwall.js b/public/javascripts/jquery.coderwall.js similarity index 100% rename from app/assets/javascripts/jquery.coderwall.js rename to public/javascripts/jquery.coderwall.js