-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
31 lines (26 loc) · 801 Bytes
/
Rakefile
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
#
# Rakefile from https://gist.github.com/1902178#file_rakefile
# http://scottwb.com/blog/2012/02/24/middleman-deployment-rakefile/
#
SSH_USER = 'user'
SSH_HOST = 'www.example.com'
SSH_DIR = '/var/www/html/www.example.com'
desc "Build the website from source"
task :build do
puts "## Building website"
status = system("middleman build --clean")
puts status ? "OK" : "FAILED"
end
desc "Run the preview server at http://localhost:4567"
task :preview do
system("middleman server")
end
desc "Deploy website via rsync"
task :deploy do
puts "## Deploying website via rsync to #{SSH_HOST}"
status = system("rsync -avze 'ssh' --delete build/ #{SSH_USER}@#{SSH_HOST}:#{SSH_DIR}")
puts status ? "OK" : "FAILED"
end
desc "Build and deploy website"
task :gen_deploy => [:build, :deploy] do
end