-
Notifications
You must be signed in to change notification settings - Fork 130
/
Rakefile
42 lines (33 loc) · 1.04 KB
/
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
35
36
37
38
39
40
41
42
require 'microstatic/rake'
require_relative 'tasks/deploy_commit_preview'
desc "deploy to www.todobackend.com"
Microstatic::Rake.s3_deploy_task(:deploy) do |task|
task.source_dir = File.expand_path("../build",__FILE__)
task.bucket_name = "www.todobackend.com"
end
desc "deploy to preview.todobackend.com"
Microstatic::Rake.s3_deploy_task(:deploy_preview) do |task|
task.source_dir = File.expand_path("../build",__FILE__)
task.bucket_name = "preview.todobackend.com"
end
task "client-build" do
cd "submodules/client"
sh "npm install"
sh "node_modules/.bin/grunt"
dest_dir = "../../build/client"
rm_rf dest_dir
mkdir_p dest_dir
cp_r FileList["index.html","js","css"], dest_dir
end
desc "serve a local development version of the site"
task "serve" do
sh "middleman server"
end
task "middleman-build" do
sh "middleman build"
end
desc "ensure dependencies are all installed and ready for deployment"
task "build" => ["middleman-build","client-build"]
desc "build, deploy"
task :build_and_deploy => [:build,:deploy]
task :default => :build