meta/new-web: minor repairs and sync script
This commit is contained in:
parent
06682cf234
commit
5efd997226
|
@ -36,3 +36,11 @@ To build:
|
||||||
* Set the $GIT_DIR environment variable to point to the ".git"
|
* Set the $GIT_DIR environment variable to point to the ".git"
|
||||||
directory of a Racket repository if you want to extract release
|
directory of a Racket repository if you want to extract release
|
||||||
information from a repository other than the enclosing one.
|
information from a repository other than the enclosing one.
|
||||||
|
|
||||||
|
To upload:
|
||||||
|
==========
|
||||||
|
|
||||||
|
* You'll need credentials to upload to S3, and those credentials
|
||||||
|
should be in "~/.aws-keys".
|
||||||
|
|
||||||
|
* Run the "sync.rkt" script: racket -l meta/new-web/sync
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
#lang plt-web
|
#lang plt-web
|
||||||
(require "resources.rkt"
|
(require "resources.rkt"
|
||||||
"data.rkt"
|
"data.rkt"
|
||||||
|
plt-web/indexes
|
||||||
version/utils)
|
version/utils)
|
||||||
|
|
||||||
(provide (all-defined-out))
|
(provide (all-defined-out))
|
||||||
|
|
||||||
|
(define download-index-site (index-site download-site))
|
||||||
|
|
||||||
;; For versions 5.92 and later, redirect "installers/<version>"
|
;; For versions 5.92 and later, redirect "installers/<version>"
|
||||||
;; and "docs/<version>/..." to "releases/<version>/..."
|
;; and "docs/<version>/..." to "releases/<version>/..."
|
||||||
(for ([r (in-list all-releases)])
|
(for ([r (in-list all-releases)])
|
||||||
|
@ -19,3 +22,29 @@
|
||||||
(symlink #:site download-site
|
(symlink #:site download-site
|
||||||
(format "../../releases/~a/pdf-doc" v)
|
(format "../../releases/~a/pdf-doc" v)
|
||||||
(format "docs/~a/pdf" v))))
|
(format "docs/~a/pdf" v))))
|
||||||
|
|
||||||
|
;; We generally expect "index.html" files to be in place in "releases"
|
||||||
|
;; and for pre-v6.0 "docs", but keep "installers", "docs", and
|
||||||
|
;; "releases" directory lists up-to-date as we add new versions:
|
||||||
|
(for ([r (in-list all-releases)])
|
||||||
|
(define v (release-version r))
|
||||||
|
(index-page download-index-site
|
||||||
|
(format "docs/~a" v)
|
||||||
|
'(("html" . dir)
|
||||||
|
("pdf" . dir))))
|
||||||
|
(void
|
||||||
|
(index-page download-index-site
|
||||||
|
"installers"
|
||||||
|
(for/list ([r (in-list all-releases)])
|
||||||
|
(cons (release-version r) 'dir))))
|
||||||
|
(void
|
||||||
|
(index-page download-index-site
|
||||||
|
"docs"
|
||||||
|
(for/list ([r (in-list all-releases)])
|
||||||
|
(cons (release-version r) 'dir))))
|
||||||
|
(void
|
||||||
|
(index-page download-index-site
|
||||||
|
"releases"
|
||||||
|
(for/list ([r (in-list all-releases)]
|
||||||
|
#:when (version<=? "5.92" (release-version r)))
|
||||||
|
(cons (release-version r) 'dir))))
|
||||||
|
|
|
@ -13,9 +13,10 @@
|
||||||
|
|
||||||
(register-identity pre-site)
|
(register-identity pre-site)
|
||||||
|
|
||||||
(define (main id)
|
(define (main path)
|
||||||
@page[#:site pre-site
|
@page[#:site pre-site
|
||||||
#:id id
|
#:file path
|
||||||
|
#:title "Racket Snapshots"
|
||||||
#:width 'full]{
|
#:width 'full]{
|
||||||
@columns[10 #:center? #t #:row? #t #:center-text? #f]{
|
@columns[10 #:center? #t #:row? #t #:center-text? #f]{
|
||||||
@h3{Snapshot Builds}}
|
@h3{Snapshot Builds}}
|
||||||
|
@ -25,7 +26,7 @@
|
||||||
@li{@a[href: "http://plt.eecs.northwestern.edu/snapshots/"]{
|
@li{@a[href: "http://plt.eecs.northwestern.edu/snapshots/"]{
|
||||||
Northwestern University}}}}})
|
Northwestern University}}}}})
|
||||||
|
|
||||||
;; Generate at both "installers.html" (traditional path)
|
;; Generate at both "installers/" (traditional path)
|
||||||
;; and "index.html" (old entry point, now subsumed)
|
;; and "index.html" (old entry point, now subsumed)
|
||||||
(define installers (main 'installers))
|
(define installers (main "installers/index.html"))
|
||||||
(void (main 'index))
|
(void (main "index.html"))
|
||||||
|
|
48
pkgs/plt-services/meta/new-web/sync.rkt
Normal file
48
pkgs/plt-services/meta/new-web/sync.rkt
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
#lang racket/load
|
||||||
|
|
||||||
|
;; This script uses the "s3-sync" package, even though the enclosing
|
||||||
|
;; package does not depend on it, and this module is written with
|
||||||
|
;; `racket/load` to avoid the dependency.
|
||||||
|
(require s3-sync)
|
||||||
|
|
||||||
|
(define (step . s)
|
||||||
|
(displayln (make-string 72 #\=))
|
||||||
|
(for-each displayln s)
|
||||||
|
(displayln (make-string 72 #\-)))
|
||||||
|
|
||||||
|
(define orig-dir (current-directory))
|
||||||
|
(define tmp-dir (make-temporary-file "sync~a" 'directory))
|
||||||
|
|
||||||
|
(current-directory tmp-dir)
|
||||||
|
|
||||||
|
;; ----------------------------------------
|
||||||
|
|
||||||
|
(step "Generate web pages")
|
||||||
|
(parameterize ([current-namespace (make-base-namespace)]
|
||||||
|
[current-command-line-arguments (vector "-w"
|
||||||
|
"-o" "generated"
|
||||||
|
"-f")])
|
||||||
|
(dynamic-require 'meta/new-web/all #f)
|
||||||
|
(dynamic-require '(submod meta/new-web/all main) #f))
|
||||||
|
|
||||||
|
(define (upload dir site)
|
||||||
|
(step (format "Uploading ~a" site))
|
||||||
|
(s3-sync (build-path "generated" dir)
|
||||||
|
site
|
||||||
|
#f
|
||||||
|
#:upload? #t
|
||||||
|
#:reduced-redundancy? #t
|
||||||
|
#:acl "public-read"
|
||||||
|
#:link-mode 'redirect
|
||||||
|
#:log displayln))
|
||||||
|
(upload "www" "racket-lang.org")
|
||||||
|
(upload "www" "www.racket-lang.org")
|
||||||
|
(upload "pre" "pre.racket-lang.org")
|
||||||
|
(upload "con" "con.racket-lang.org")
|
||||||
|
(upload "drracket" "www.drracket.org")
|
||||||
|
(upload "download" "download.racket-lang.org")
|
||||||
|
|
||||||
|
;; ----------------------------------------
|
||||||
|
|
||||||
|
(current-directory orig-dir)
|
||||||
|
(delete-directory/files tmp-dir)
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
(define www-site
|
(define www-site
|
||||||
(site "www"
|
(site "www"
|
||||||
#:url (rewrite-for-testing "http://www.racket-lang.org/")
|
#:url (rewrite-for-testing "http://racket-lang.org/")
|
||||||
#:page-headers (identity-headers)
|
#:page-headers (identity-headers)
|
||||||
#:navigation
|
#:navigation
|
||||||
(list
|
(list
|
||||||
|
|
Loading…
Reference in New Issue
Block a user