added before_deploy and after_deploy tasks
This commit is contained in:
parent
356494b78b
commit
f0a698d806
2 changed files with 29 additions and 0 deletions
13
lib/tasks/after_deploy.rake
Normal file
13
lib/tasks/after_deploy.rake
Normal 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
|
||||||
16
lib/tasks/before_deploy.rake
Normal file
16
lib/tasks/before_deploy.rake
Normal 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
|
||||||
Loading…
Reference in a new issue