...
|
...
|
@@ -61,8 +61,7 @@ task :generate_site => [:clean, :generate_style] do
|
61
|
61
|
end
|
62
|
62
|
|
63
|
63
|
def rebuild_site(relative)
|
64
|
|
- puts "\n"
|
65
|
|
- puts ">>> Change Detected to: #{relative} <<<"
|
|
64
|
+ puts "\n\n>>> Change Detected to: #{relative} <<<"
|
66
|
65
|
IO.popen('rake generate_site'){|io| print(io.readpartial(512)) until io.eof?}
|
67
|
66
|
puts '>>> Update Complete <<<'
|
68
|
67
|
end
|
...
|
...
|
@@ -94,23 +93,29 @@ end
|
94
|
94
|
|
95
|
95
|
desc "generate and deploy website via rsync"
|
96
|
96
|
multitask :deploy_rsync => [:default, :clean_debug] do
|
97
|
|
- print ">>> Deploying website <<<"
|
|
97
|
+ puts ">>> Deploying website to #{site_url} <<<"
|
98
|
98
|
ok_failed system("rsync -avz --delete #{site}/ #{ssh_user}:#{document_root}")
|
99
|
99
|
end
|
100
|
100
|
|
101
|
101
|
desc "generate and deploy website to github user pages"
|
102
|
102
|
multitask :deploy_github => [:default, :clean_debug] do
|
|
103
|
+ puts ">>> Deploying #{deploy_branch} branch to Github Pages <<<"
|
103
|
104
|
require 'git'
|
104
|
105
|
repo = Git.open('.')
|
|
106
|
+ puts "\n>>> Checking out #{deploy_branch} branch <<<\n"
|
105
|
107
|
repo.branch("#{deploy_branch}").checkout
|
106
|
108
|
(Dir["*"] - [site]).each { |f| rm_rf(f) }
|
107
|
109
|
Dir["#{site}/*"].each {|f| mv(f, ".")}
|
108
|
110
|
rm_rf(site)
|
|
111
|
+ puts "\n>>> Moving generated site files <<<\n"
|
109
|
112
|
Dir["**/*"].each {|f| repo.add(f) }
|
110
|
113
|
repo.status.deleted.each {|f, s| repo.remove(f)}
|
|
114
|
+ puts "\n>>> Commiting: Site updated at #{Time.now.utc} <<<\n"
|
111
|
115
|
message = ENV["MESSAGE"] || "Site updated at #{Time.now.utc}"
|
112
|
116
|
repo.commit(message)
|
|
117
|
+ puts "\n>>> Pushing generated site to #{deploy_branch} branch <<<\n"
|
113
|
118
|
repo.push
|
|
119
|
+ puts "\n>>> Github Pages deploy complete <<<\n"
|
114
|
120
|
repo.branch("#{source_branch}").checkout
|
115
|
121
|
end
|
116
|
122
|
|