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 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