aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB Mathis <brandon@imathis.com>2009-11-25 08:18:54 -0600
committerB Mathis <brandon@imathis.com>2009-11-25 08:18:54 -0600
commitb12b0370919e9153c2b1cccf119995b65de2b385 (patch)
treeb921e42c4a85f561699540a1b414b3783eb4449c
parentffc29620012cf27642f5d7b0aa82b5e67c870f8a (diff)
downloadmy_new_personal_website-b12b0370919e9153c2b1cccf119995b65de2b385.tar.xz
my_new_personal_website-b12b0370919e9153c2b1cccf119995b65de2b385.zip
improved rake file feedback during deploy
-rw-r--r--Rakefile11
1 files changed, 8 insertions, 3 deletions
diff --git a/Rakefile b/Rakefile
index c4e18bf7..3078f1b5 100644
--- a/Rakefile
+++ b/Rakefile
@@ -61,8 +61,7 @@ task :generate_site => [:clean, :generate_style] do
end
def rebuild_site(relative)
- puts "\n"
- puts ">>> Change Detected to: #{relative} <<<"
+ puts "\n\n>>> Change Detected to: #{relative} <<<"
IO.popen('rake generate_site'){|io| print(io.readpartial(512)) until io.eof?}
puts '>>> Update Complete <<<'
end
@@ -94,23 +93,29 @@ end
desc "generate and deploy website via rsync"
multitask :deploy_rsync => [:default, :clean_debug] do
- print ">>> Deploying website <<<"
+ puts ">>> Deploying website to #{site_url} <<<"
ok_failed system("rsync -avz --delete #{site}/ #{ssh_user}:#{document_root}")
end
desc "generate and deploy website to github user pages"
multitask :deploy_github => [:default, :clean_debug] do
+ puts ">>> Deploying #{deploy_branch} branch to Github Pages <<<"
require 'git'
repo = Git.open('.')
+ puts "\n>>> Checking out #{deploy_branch} branch <<<\n"
repo.branch("#{deploy_branch}").checkout
(Dir["*"] - [site]).each { |f| rm_rf(f) }
Dir["#{site}/*"].each {|f| mv(f, ".")}
rm_rf(site)
+ puts "\n>>> Moving generated site files <<<\n"
Dir["**/*"].each {|f| repo.add(f) }
repo.status.deleted.each {|f, s| repo.remove(f)}
+ puts "\n>>> Commiting: Site updated at #{Time.now.utc} <<<\n"
message = ENV["MESSAGE"] || "Site updated at #{Time.now.utc}"
repo.commit(message)
+ puts "\n>>> Pushing generated site to #{deploy_branch} branch <<<\n"
repo.push
+ puts "\n>>> Github Pages deploy complete <<<\n"
repo.branch("#{source_branch}").checkout
end