-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathupload.sh
executable file
·37 lines (27 loc) · 929 Bytes
/
upload.sh
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
#!/usr/bin/env sh
zip() {
echo "gzipping $1"
gzip -9 $1
mv $1.gz $1
}
upload() {
echo "uploading $1"
# index.*.css
s3cmd sync $1 --add-header "Content-Encoding: gzip" --mime-type="text/css" --acl-public out/css/index.*.css s3://www.voxelmars.com/css/
# index.*.js
s3cmd sync $1 --add-header "Content-Encoding: gzip" --mime-type="application/javascript" --acl-public out/js/index.*.js s3://www.voxelmars.com/js/
# index.html
s3cmd sync $1 --add-header "Cache-Control: no-cache, no-store, must-revalidate" --add-header "Pragma: no-cache" --add-header "Expires: 0" --mime-type="text/html" --acl-public out/index.html s3://www.voxelmars.com/
# sync /out
s3cmd sync $1 --delete-removed --exclude '.DS_Store' out/ s3://www.voxelmars.com/
}
zip out/css/index.*.css
zip out/js/index.*.js
upload --dry-run
read -p "Continue? (y/N) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo 'yep'
upload
fi