-
Notifications
You must be signed in to change notification settings - Fork 53
/
Rakefile
34 lines (29 loc) · 824 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
32
33
34
require "middleman-s3_sync"
require "middleman-cloudfront"
desc "Build the website from source"
task :build do
puts "## Building website"
status = system("bundle exec middleman build --clean")
puts status ? "OK" : "FAILED"
end
desc "Run the preview server at http://localhost:4567"
task :preview do
system("bundle exec middleman server")
end
desc "Deploy website via rsync"
task :deploy do
puts '## Syncing to S3...'
system "bundle exec middleman s3_sync"
puts '## Invalidating cloudfront...'
system "bundle exec middleman invalidate"
puts '## Deploy complete.'
end
desc "Clean up the deploy"
task :cleanup do
puts "## Cleaning build"
status = system("rm -rf build")
puts status ? "OK" : "FAILED"
end
desc "Build and deploy website"
task :build_deploy => [:build, :deploy, :cleanup] do
end