Last modified 4 years ago Last modified on 06/09/08 21:16:34

Nightly builds

Every night this server produces nightly builds of the most current revision for Windows systems of Warzone 2100. These can be found here: http://warzone.mortis.eu/nightly-builds/

Build script

For those interested, this is the build script that is used.

#!/bin/sh

# Path to working copy
WC="/home/mortis/svn/warzone/wz-trunk"

# Path to download directory
TARGET_DIR="/var/www/warzone.mortis.eu/nightly-builds/"

# Set locale to C so that we can depend on the output from some commands
export LC_ALL=C

function select_revision()
{
        svn up "${WC}" "$@"

        # Clean the working copy
        rm -r $(svn status "${WC}" --no-ignore | grep '^[\?I]' | sed 's/^[\?I] \+//g')
        svn revert -R "${WC}"

        REVISION=$(svn info "${WC}" | grep '^Revision: ' | sed 's/^Revision: //')
}

function build_installer()
{
        if [[ "x$1" = "xdebug" || "x$1" = "xdebug-relaxed" ]] ; then
                BUILD_TYPE="debug"
                INSTALLER="${TARGET_DIR}warzone2100_r${REVISION}-debug.exe"
        else
                BUILD_TYPE="non-debug"
                INSTALLER="${TARGET_DIR}warzone2100_r${REVISION}.exe"
        fi

        cd "${WC}/win32"

        if [ ! -f "${INSTALLER}" ] ; then
                # Clean part of the working copy
                for dir in lib src pkg po; do
                        rm -r $(svn status "${WC}/${dir}" --no-ignore | grep '^[\?I]' | sed 's/^[\?I] \+//g')
                done
                svn revert -R "${WC}"

                # Recreate the symlink to the config file
                ln -s "/home/mortis/svn/warzone/__BUILD_CONFIG.USER" "${WC}/win32/__BUILD_CONFIG.USER"

                # Build the installer
                nice -n19 ./__BUILD_SCRIPT "$@" || {
                        echo "Error, failed to build ${BUILD_TYPE} executable for revision ${REVISION}!" >&2
                        exit 1
                }

                mv "${WC}/pkg/nsis/warzone2100-TRUNK.exe" "${INSTALLER}"

                # Sign the freshly created installer with the "automated key"
                gpg --local-user 0xb3043ea3 --detach-sign "${INSTALLER}"
        else
                echo "${INSTALLER} is built already."
        fi
}

# Select the revision to use for compiling
select_revision "-rHEAD"

# Build the non-debug installer
build_installer installer --with-installer-compression=zlib

# Build the debug installer
build_installer debug-relaxed installer --with-installer-compression=zlib