forked from geeksam/think-like-a-git-dot-net
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
44 lines (36 loc) · 1013 Bytes
/
Rakefile
File metadata and controls
44 lines (36 loc) · 1013 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
##### General configuration #####
require 'ostruct'
SITE = OpenStruct.new
SITE.output_dir = File.expand_path(File.join(File.dirname(__FILE__), *%w[build]))
SITE.rsync_args = %w[-av]
SITE.user = 'geeksam'
SITE.host = 'think-like-a-git.net'
SITE.remote_dir = '/home/geeksam/think-like-a-git.net/'
##### Site building #####
desc 'Build the site'
task :build do
sh 'middleman build'
end
task :clear_build_dir do
sh "rm -rf #{SITE.output_dir}"
end
desc 'Completely rebuild the site'
task :rebuild => ['clear_build_dir', 'build']
##### Deployment #####
#require 'rake/contrib/sshpublisher'
namespace :deploy do
desc 'Deploy to the server using rsync'
task :rsync do
cmd = "rsync #{SITE.rsync_args.join(' ')} "
cmd << "#{SITE.output_dir}/ #{SITE.user}@#{SITE.host}:#{SITE.remote_dir}"
sh cmd
end
end
namespace :deploy do
task :github do
sh "rm -rf docs"
sh "mv build docs"
end
end
desc 'deploy the site to the webserver'
task :deploy => ['rebuild', 'deploy:github']