Examining nightly builds
If you want to see a recent nightly build, download a source or binary distro as packaged, from http://download.openlaszlo.org/nightly/ or test the most recent live build on labs, at http://labs.openlaszlo.org/trunk-nightly/ Or you can browse the svn tag from which this build was created at http://svn.openlaszlo.org/openlaszlo/builds/
Running a nightly build
Builds are "kicked off" automatically by a cron task on linux-builder. The cron task is owned by the user svnbuild. The very best way to run a build is to do nothing; the build will be kicked off by cron at around 2 or 3 am, and about an hour later, the build products will appear on http://download.openlaszlo.org/nightly/ and mail will go to the laszlo-builds mailing list.
If you want to kick off a build for right now, and have it exactly match the conditions under which the nightly builds are run, log on to linux-builder as user svnbuild, and edit the crontab (the list of cron tasks) so that the crontab entry which invokes the build you want to build includes an invocation in the near future. cron is a bit difficult to explain; suffice it to say that... the first two entries in each line are minutes after the hour and </em>hour in 24-hour time</em> at which that command should be invoked.
List the current crontab
[svnbuild@linux-builder ~]$ crontab -l 0 3 * * * /home/svnbuild/src/svn/tools/trunk/build-tools/nightly/nightly-go.sh 37 2,13 * * * /home/svnbuild/src/svn/tools/trunk/build-tools/nightly/nightly-go.sh branches/legals
The interesting thing here is that a build of legals is scheduled to occur at 1:37 PM. I put the ",13" entry on the "hours" column when, at 1:30 PM, someone asked me to kick off a build.
To edit the crontab, do crontab -e
What's really happening
The nightly build script, nightly-go.sh, does many things. See the source for the details, but roughly, here's what happens:
- It determines what branch and revision number to use, based on passed-in parameters. If no command line arguments are specified, it uses the latest revision of trunk.
- It sends mail saying it's starting.
- It invokes build.xml in the nightly/ directory, with a bunch of targets set to control which parts of the build happen.
- It sends mail saying that the build completed, either success or failure.
The interesting part of this, of course, is what happens inside the build.xml file.
For a normal nightly build, we execute the "nightly" target
<target name="nightly" depends="init"> <ant target="svn-make-tag" /> <ant target="svn-update-to-tag" /> <ant target="push-to-children" /> <ant target="make-download-dest-dir" /> <ant target="build" /> <ant target="lztest" /> <ant target="push-to-download"/> </target>
Reading the list of targets in order describes what the build actually does:
- svn-make-tag creates a tag of the specified branch at the specified revision number
- svn-update-to-tag checks out the just created tag to a brand new clean directory on ~svnbuild/builds/
- push-to-children rsync's that clean tree to windows-builder and tiger-builder
- make-download-destdir creates a directory on download.openlaszlo.org with the name of the build, ready to hold the build products.
- build calls "ant dist-one" in the tree we just checked out
- It also calls kick-off-windows and kick-off-mac, which starts the build on each of those machines.
- See tiger-builder-go.sh and windows-builder-go.sh for exactly what these do.
- lztest only applies to legals builds; it runs the "ant lztest" task, and fails the build if the tests fail.
- push-to-download pushes the linux-builder products to download.openlaszlo.org.
Finding information about builds
On linux-builder, information about builds lives in two places: ~/builds: actual svn working copies of a particular tagged build ~/logs: the log that matches each of the tagged builds. Every build should have a directory in ~/builds/buildname and a corresponding log in ~/logs/buildname.log.
tiger-builder and linux-builder have the same directory structure, but the ~/builds directory does not contain an svn working copy! ~/builds ~/logs
The logs on linux-builder will give you the most information about the build.
See Setting Up Tiger Builder for instructions on how to set up a new build machine.