6 Examples
Here are some example configuration files.
6.1 Single Installer
The simplest possible configuration file is
#lang distro-build/config (machine)
In fact, this configuration file is created automatically as "build/site.rkt" (if the file does not exist already) and used as the default configuration. With this configuration,
make installers
creates an installer in "build/installers" for the platform that is used to create the installer.
6.2 Installer Web Page
To make a web page that serves both a minimal installer and packages, create a "site.rkt" file with
#lang distro-build/config (sequential ;; The packages that will be available: #:pkgs '("main-distribution") ;; FIXME: the URL where the installer and packages will be: #:dist-base-url "http://my-server.domain/snapshot/" (machine ;; FIXME: the way the installer is described on the web page: #:name "Minimal Racket | My Platform" ;; The packages in this installer: #:pkgs '()))
then
make site CONFIG=site.rkt
creates a "build/site" directory that you can move to your web server’s "snapshot" directory, so that "build/site/index.html" is the main page, and so on.
6.3 Accumulated Shapshots Web Page
To make a web site that provides some number (5, by default) of snapshots, use (current-stamp) when constructing the #:dist-base-url value. Also, use (current-stamp) as the directory for assembling the site:
#lang distro-build/config (sequential ;; The packages that will be available: #:pkgs '("gui-lib") ;; FIXME: the URL where the installer and packages will be: #:dist-base-url (string-append "http://my-server.domain/snapshots/" (current-stamp) "/") ;; The local directory where a snapshot is written #:site-dest (build-path "build/site" (current-stamp)) (machine ;; FIXME: the way the installer is described on the web page: #:name "Minimal Racket | My Platform" ;; The packages in this installer: #:pkgs '()))
Then,
make snapshot-site CONFIG=site.rkt
creates a "build/site" directory that you can move to your web server’s "snapshots" directory, so that "build/site/index.html" is the main page that initially points to "build/site/‹stamp›/index.html", and so on. To make a newer snapshot, update the Git repository, leave "build/site" in place, and run
make snapshot-site CONFIG=site.rkt
again. The new installers will go into a new <stamp> subdirectory, and the main "index.html" file will be rewritten to point to them.
6.4 Multiple Platforms
A configuration module that drives multiple clients to build installers might look like this:
#lang distro-build/config (sequential #:pkgs '("drracket") #:server-hosts '() ; Insecure? See below. (machine #:desc "Linux (32-bit, Precise Pangolin)" #:name "Ubuntu 32" #:vbox "Ubuntu 12.04" #:host "192.168.56.102") (machine #:desc "Windows (64-bit)" #:name "Windows 64" #:host "10.0.0.7" #:server "10.0.0.1" #:dir "c:\\Users\\racket\\build\\plt" #:platform 'windows #:bits 64))
The configuration describes using the hosts "192.168.56.1" and "10.0.0.7" for Linux and Windows builds, respectively, which are run one at a time.
The Linux machine runs in VirtualBox on the server machine (in a virtual machine named "Ubuntu 12.04"). It contacts the server still as localhost, and that works because the SSH connection to the Linux machine creates a tunnel (at the same port as the server’s, which defaults to 9440).
The Windows machine uses freeSSHd (not a bash-based SSH server
like Cygwin) and communicates back to the server as
"10.0.0.1" instead of using an SSH tunnel. To make that work,
#:server-hosts is specified as the empty list to make the
server listen on all interfaces (instead of just
"localhost")—
With this configuration file in "site.rkt",
make installers CONFIG=site.rkt
produces two installers, both in "build/installers", and a hash table in "table.rktd" that maps "Linux (32-bit, Precise Pangolin)" to the Linux installer and "Windows (64-bit)" to the Windows installer.