diff options
author | B Mathis <brandon@imathis.com> | 2009-11-25 08:18:54 -0600 |
---|---|---|
committer | B Mathis <brandon@imathis.com> | 2009-11-25 08:18:54 -0600 |
commit | b12b0370919e9153c2b1cccf119995b65de2b385 (patch) | |
tree | b921e42c4a85f561699540a1b414b3783eb4449c | |
parent | ffc29620012cf27642f5d7b0aa82b5e67c870f8a (diff) | |
download | my_new_personal_website-b12b0370919e9153c2b1cccf119995b65de2b385.tar.xz my_new_personal_website-b12b0370919e9153c2b1cccf119995b65de2b385.zip |
improved rake file feedback during deploy
-rw-r--r-- | Rakefile | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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 |