-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
88 lines (76 loc) · 1.89 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
task :default => :loop
task :release => [ :build, :assemble, :zip ]
task :heroku => [ :build, :assemble, :'stage:heroku' ]
desc "loop"
task :loop do
sh %(
brunch watch --server -p 9001
)
end
desc "build"
task :build do
sh %(
npm install
bower install
brunch build --production # will build to build/
)
end
desc "assemble"
task :assemble do
sh %(
# ## ship static/, app/data, .tmp/scripts/injectees
# rsync -av static/* build/
# ## assume bbl-middleman is built, ship intro.
# rsync -av ../bbl-middleman/build/webbuddy/intro build/
)
end
# desc "deploy to Google Drive"
# task :stage do
# # copy the entire project to ease collaboration with designers
# sh %(rsync -av --delete --exclude='.tmp' --exclude='.sass-cache' * "#{ENV['HOME']}/Google Drive/bigbearlabs/webbuddy-preview/webbuddy-plugins/")
# end
desc "deploy to bbl-rails on heroku"
task :'stage:heroku' do
sh %(
echo "## copy to webbuddy-extensions"
rsync -av --delete --no-implied-dirs build/* ../bbl-rails/public/webbuddy-extensions/
cd ../bbl-rails
echo "## commit"
git add -A public/webbuddy-extensions
git ci -a -m "updating webbuddy-extensions, #{Time.new.to_s}"
git push heroku
echo "## pushed to heroku"
)
end
desc "zip extension"
task :zip => [] do
releases_root = 'dist'
zip_name = "webbuddy-extension-chrome.#{Time.new.to_i}.zip"
target_dir = "build"
sh %Q(
(
cd #{target_dir}
grep -v // manifest.json > manifest.json.scrubbed # remove comments from json
mv manifest.json.scrubbed manifest.json
zip -r #{zip_name} .
)
mv "#{target_dir}/#{zip_name}" #{releases_root}
)
end
desc "clean"
task :clean do
sh %(
rm -rf build/
)
end
desc 'bootstrap'
task :'bootstrap' do
sh %(
# needs npm, bower.
npm install -g grunt-cli
npm install -g grunt
npm install -g brunch
npm install
bower install
)
end