diff --git a/lib/tasks/after_deploy.rake b/lib/tasks/after_deploy.rake new file mode 100644 index 0000000000000000000000000000000000000000..16d3707c5021641e11654c5793ed308ef593842b --- /dev/null +++ b/lib/tasks/after_deploy.rake @@ -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 diff --git a/lib/tasks/before_deploy.rake b/lib/tasks/before_deploy.rake new file mode 100644 index 0000000000000000000000000000000000000000..4dc4c6b6dfc520beb6a3ea3013af80a04371bdec --- /dev/null +++ b/lib/tasks/before_deploy.rake @@ -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