Rev 842 | Rev 851 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
BUILD SERVER SETUP
=== INTRO =====================================================================
The SvarDOS build system is entirely stored in the project's svn repository.
This includes many components:
- SvarDOS-specific tools (install, pkg, pkgnet, localcfg, svarcom, help, ...)
- SvarDOS packages
- SvarDOS website
- build scripts and tools
This means that the project's svn tree contains everything that is required
to build SvarDOS.
=== SVN SERVICE ===============================================================
The server must have a subversion service installed with the SvarDOS repository
imported.
The only specific configuration concerns a post-commit hook that creates a flag
file at /tmp/svados_repo_changed.flag whenever a commit is made to the repo and
another flag in /tmp/svardos_rebuilt_please.flag if the commit might impact the
content of installation images. Here below is the necessary post-commit hook,
it should be placed in the hooks/ directory of the svn server and made
executable (chmod +x):
#!/bin/sh
SVNLOOK=/usr/bin/svnlook
REPOS="$1"
REV="$2"
# first of all, make sure to set a flag that says "svn content changed" so a
# cron job can update its local copy later
echo `date` > /tmp/svardos_repo_changed.flag
# check if any of the following locations have been updated during the commit:
# - files
# - packages/core/
# - build.sh
#
# any change to one of these locations means that the content of the
# installation images may have been impacted, hence a rebuild may be necessary.
#
$SVNLOOK changed -r "$REV" "$REPOS" | grep -e ' files' -e ' build.sh' -e ' packages/core/' > /dev/null
# if a location matched, then set a flag so a cron job rebuilds the images
# and send an information message back to the committer.
if [ $? -eq 0 ] ; then
echo `date` > /tmp/svardos_rebuild_please.flag
echo "NOTICE: a build-impacting location has been updated." >&2
echo " install images have been scheduled for a rebuild." >&2
exit 1
fi
exit 0
=== SVN CLIENT ================================================================
The SvarDOS repository should be checked out in /srv/svardos/:
$ svn co svn://127.0.0.1/svardos /srv/svardos
=== WEB SERVICE ===============================================================
A web server with PHP must be running (typically Apache). The PHP installation
needs the php-zip extension (required by buildidx), and the Apache web root
should point at /srv/svardos/website.
=== CRON ACTIONS ==============================================================
A cron job should be configured to run frequently (like every minute) and
execute the /srv/svardos/cron.sh script. This script is responsible for
checking out the local svardos repo whenever a new commit is being made, and
rebuilds the index of the packages repository.
=== MIRRORING THE PROJECT'S SVN ===============================================
Mirroring the project's svn tree (containing all build scripts, packages, etc)
is the best way to make a backup copy of the entire SvarDOS build system along
with all its history. To achieve such mirror, one needs to create an empty
svn repository and populate it using svnsync:
$ svnadmin create /srv/svardos-mirror
$ svnsync init file:///srv/svardos-mirror svn://svn.svardos.org/svardos
$ svn up /srv/svardos-mirror
The same procedure can be used to migrate the SvarDOS build system from one
server to another.
NOTE: The target svn server must allow modification of revision properties.
This is achieved with a svn "pre-revprop-change" hook of two lines:
#!/bin/sh
exit 0
======================================================================= EOF ===