added before_deploy and after_deploy tasks

This commit is contained in:
danielgrippi 2012-01-18 16:43:40 -08:00 committed by Maxwell Salzberg
parent 356494b78b
commit f0a698d806
2 changed files with 29 additions and 0 deletions

View file

@ -0,0 +1,13 @@
desc "revert custom landing page commit after heroku san deploys"
task :after_deploy => :environment do
# Perform this task only if custom landing page is not present in app/views/home/_show.html.haml
if File.exist?(File.join(Rails.root, "app", "views", "home", "_show.html.haml")) && system("git log | head -5 | grep 'custom\ landing\ page'")
puts "-----> resetting HEAD before custom landing page commit"
system("git reset --hard HEAD^") ? true : fail
puts "-----> done"
end
end

View file

@ -0,0 +1,16 @@
desc "include custom landing page before heroku san deploys"
task :before_deploy => :environment do
# Perform this task only if custom landing page is not present in app/views/home/_show.html.haml
if File.exist?(File.join(Rails.root, "app", "views", "home", "_show.html.haml"))
puts "-----> custom landing page detected..."
puts "-----> including custom landing page in a temp commit"
system("git add app/views/home/_show.html.haml -f") ? true : fail
system("git commit -m 'adding custom landing page for heroku'") ? true : fail
puts "-----> done"
end
end