Final S3 changes
This commit is contained in:
parent
caf69b0c8a
commit
8ff0193ebe
|
@ -1,7 +1,3 @@
|
||||||
/root
|
/root
|
||||||
/static/pkgs
|
/static-gen
|
||||||
/static/pkg
|
/static-gen.gz
|
||||||
/static/pkgs-all
|
|
||||||
*json
|
|
||||||
/static/atom.xml
|
|
||||||
/static.gz
|
|
||||||
|
|
|
@ -27,7 +27,8 @@
|
||||||
(define pkgs-path (build-path root "pkgs"))
|
(define pkgs-path (build-path root "pkgs"))
|
||||||
(make-directory* pkgs-path)
|
(make-directory* pkgs-path)
|
||||||
|
|
||||||
(define static-path (build-path src "static"))
|
(define static.src-path (build-path src "static"))
|
||||||
|
(define static-path (build-path src "static-gen"))
|
||||||
|
|
||||||
(define (package-list)
|
(define (package-list)
|
||||||
(sort (map path->string (directory-list pkgs-path))
|
(sort (map path->string (directory-list pkgs-path))
|
||||||
|
|
|
@ -53,8 +53,10 @@
|
||||||
(package-info p)
|
(package-info p)
|
||||||
#hash()))
|
#hash()))
|
||||||
(define new-pi (hash-deep-merge pi more-pi))
|
(define new-pi (hash-deep-merge pi more-pi))
|
||||||
(define updated-pi (let ([now (current-seconds)])
|
(define updated-pi
|
||||||
(for/fold ([pi new-pi]) ([k (in-list '(last-edit last-checked last-updated))])
|
(let ([now (current-seconds)])
|
||||||
|
(for/fold ([pi new-pi])
|
||||||
|
([k (in-list '(last-edit last-checked last-updated))])
|
||||||
(hash-set pi k now))))
|
(hash-set pi k now))))
|
||||||
(package-info-set! p updated-pi)
|
(package-info-set! p updated-pi)
|
||||||
(signal-update! (list p)))
|
(signal-update! (list p)))
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
(make-directory* (path-only p)))
|
(make-directory* (path-only p)))
|
||||||
|
|
||||||
(define s3-config (build-path (find-system-path 'home-dir) ".s3cfg-plt"))
|
(define s3-config (build-path (find-system-path 'home-dir) ".s3cfg-plt"))
|
||||||
(define s3-bucket "pkg.racket-lang.org")
|
(define s3-bucket "pkgs.racket-lang.org")
|
||||||
|
|
||||||
(define static.gz-path (path-add-suffix static-path ".gz"))
|
(define static.gz-path (path-add-suffix static-path ".gz"))
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
(require web-server/http
|
(require web-server/http
|
||||||
web-server/dispatch
|
web-server/dispatch
|
||||||
racket/file
|
racket/file
|
||||||
|
racket/port
|
||||||
|
racket/system
|
||||||
racket/match
|
racket/match
|
||||||
json
|
json
|
||||||
racket/date
|
racket/date
|
||||||
|
@ -239,14 +241,26 @@
|
||||||
(define (cache url file)
|
(define (cache url file)
|
||||||
(define p (build-path static-path file))
|
(define p (build-path static-path file))
|
||||||
(make-directory* (path-only p))
|
(make-directory* (path-only p))
|
||||||
|
|
||||||
|
(define bs
|
||||||
|
(with-output-to-bytes
|
||||||
|
(λ ()
|
||||||
|
((response-output (main-dispatch (url->request url)))
|
||||||
|
(current-output-port)))))
|
||||||
|
(unless (and (file-exists? p)
|
||||||
|
(bytes=? bs (file->bytes p)))
|
||||||
(with-output-to-file p
|
(with-output-to-file p
|
||||||
#:exists 'replace
|
#:exists 'replace
|
||||||
(λ () ((response-output (main-dispatch (url->request url))) (current-output-port))))
|
(λ () (display bs)))
|
||||||
(with-output-to-file (path-add-suffix p #".json")
|
(with-output-to-file (path-add-suffix p #".json")
|
||||||
#:exists 'replace
|
#:exists 'replace
|
||||||
(λ () (write-json (convert-to-json (file->value p)))))
|
(λ () (write-json (convert-to-json (file->value p))))))
|
||||||
(void))
|
(void))
|
||||||
|
|
||||||
|
(system (format "cp -pr ~a/* ~a/"
|
||||||
|
static.src-path
|
||||||
|
static-path))
|
||||||
|
|
||||||
(cache "/atom.xml" "atom.xml")
|
(cache "/atom.xml" "atom.xml")
|
||||||
(cache "/pkgs" "pkgs")
|
(cache "/pkgs" "pkgs")
|
||||||
(cache "/pkgs-all" "pkgs-all")
|
(cache "/pkgs-all" "pkgs-all")
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
var dynamic_host = "pkgd.racket-lang.org";
|
// xxx change this once the new dns entries are in
|
||||||
var dynamic_port = 443;
|
//var dynamic_host = "pkgd.racket-lang.org";
|
||||||
|
//var dynamic_port = 443;
|
||||||
|
var dynamic_host = "plt-etc.byu.edu";
|
||||||
|
var dynamic_port = 9004;
|
||||||
|
|
||||||
function dynamic_url ( u ) {
|
function dynamic_url ( u ) {
|
||||||
return "https://" + dynamic_host + ":" + dynamic_port + u + "?callback=?"; }
|
return "https://" + dynamic_host + ":" + dynamic_port + u + "?callback=?"; }
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# planet-compat
|
# planet-compat
|
||||||
rsync -a --progress -h --delete --exclude root --exclude compiled --exclude doc ../../meta/pkg-index/ plt-etc:local/new-plt/pkgs/plt-services/meta/pkg-index/
|
rsync -a --progress -h --delete --exclude root --exclude static-gen --exclude static-gen.gz --exclude compiled --exclude doc ../../meta/pkg-index/ plt-etc:local/new-plt/pkgs/plt-services/meta/pkg-index/
|
||||||
rsync -a --progress -h --delete plt-etc:local/galaxy-roots/planet-compat/ planet-compat/root/
|
rsync -a --progress -h --delete plt-etc:local/galaxy-roots/planet-compat/ planet-compat/root/
|
||||||
rsync -a --progress -h --delete plt-etc:local/galaxy-roots/official/ official/root/
|
rsync -a --progress -h --delete plt-etc:local/galaxy-roots/official/ official/root/
|
||||||
|
|
||||||
|
rsync -a --progress -h --delete plt-etc:local/new-plt/pkgs/plt-services/meta/pkg-index//official/static-gen official/static-gen
|
||||||
|
rsync -a --progress -h --delete plt-etc:local/new-plt/pkgs/plt-services/meta/pkg-index//official/static-gen.gz official/static-gen.gz
|
||||||
|
|
||||||
# official
|
# official
|
||||||
rsync -a --progress -h --delete --exclude root --exclude compiled --exclude doc ../../meta/pkg-index/ plt-etc:local/galaxy/meta/pkg-index/
|
rsync -a --progress -h --delete --exclude root --exclude compiled --exclude doc ../../meta/pkg-index/ plt-etc:local/galaxy/meta/pkg-index/
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user