-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
33 lines (28 loc) · 922 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
task :build do
system "npm run build"
end
task :shrink_images do
opts = [
"-filter Triangle",
"-resize '900x100000>'",
"-quality 85",
"-define png:compression-filter=5",
"-define png:compression-strategy=1",
"-define png:compression-level=9",
"-define png:exclude-chunk=all",
"-interlace none",
"-colorspace sRGB",
"-strip",
"-background '#fbfdff' -flatten"
].join(" ")
Dir["app/assets/art_large/*.png"].each { |file|
target = "app/assets/art/#{file.split("/").last}".sub("png", "jpg")
system "convert #{file} #{opts} #{target}"
}
end
task :publish => [:shrink_images, :build] do
puts "Uploading to S3 (Requires a valid session with bonsai account)"
system "cd dist && aws s3 sync . s3://storyofsearch"
puts "Invalidating Cloudfront Caches"
system "aws cloudfront create-invalidation --distribution-id E98BQDRSSTCXI --paths / /* /index.html"
end