meta/new-web: use --web mode of raco s3-sync

A side effect of this change is that ".html" files bigger than
1k are gzipped, in addition to ".css" and ".js" files. I find
several web comments to the effect that gziping ".html" files works
fine, because all browsers support it, and no warnings against.
Since gzipping ".css" and ".js" files has worked fine for us, too,
lets take the plunge and try gzipping ".html".
This commit is contained in:
Matthew Flatt 2014-08-06 10:46:27 +01:00
parent 3f9d86c348
commit d5db02603a

View File

@ -20,7 +20,7 @@
;; Manually check package install and version:
(define s3-sync-pkg "s3-sync")
(define min-s3-sync-vers "1.1")
(define min-s3-sync-vers "1.3")
(require pkg/lib
setup/getinfo
version/utils)
@ -36,8 +36,7 @@
"please update the ~s package to get version ~a or later"
s3-sync-pkg min-s3-sync-vers))))
(require s3-sync
s3-sync/gzip)
(require s3-sync/web)
(define (step . s)
(displayln (make-string 72 #\=))
@ -59,23 +58,16 @@
(dynamic-require 'meta/new-web/all #f)
(dynamic-require '(submod meta/new-web/all main) #f))
(define-values (gzip-web-in gzip-web-enc)
(make-gzip-handlers #rx"[.](css|js)$" #:min-size (* 1 1024)))
(define (upload dir site #:shallow? [shallow? #f])
(step (format "Uploading ~a" site))
(s3-sync (build-path "generated" dir)
site
#f
#:dry-run? dry-run?
#:shallow? shallow?
#:upload? #t
#:reduced-redundancy? #t
#:acl "public-read"
#:link-mode 'redirect
#:make-call-with-input-file gzip-web-in
#:get-content-encoding gzip-web-enc
#:log displayln))
(s3-web-sync (build-path "generated" dir)
site
#f
#:dry-run? dry-run?
#:shallow? shallow?
#:upload? #t
#:link-mode 'redirect
#:log displayln))
(upload "www" "racket-lang.org")
(upload "www" "www.racket-lang.org")
(upload "pre" "pre.racket-lang.org")