From: Jan-Benedict G. <jb...@us...> - 2005-12-16 11:30:22
|
Update of /cvsroot/linux-vax/toolchain/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4163 Modified Files: README Added Files: run_test_build.sh Log Message: - Here's my build robot, barely running and not yet calling update_cvs, because esp. the SF CVS server is resetting the TCP connection at a rate of ~ 80 %... - I need a nice name for it! - If you want to get build results, drop me an email. It'll always send the diff towards the last successful build. Index: README =================================================================== RCS file: /cvsroot/linux-vax/toolchain/scripts/README,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- README 5 Jun 2005 16:24:29 -0000 1.11 +++ README 16 Dec 2005 11:30:07 -0000 1.12 @@ -117,3 +117,20 @@ manually, but it's of little use... It'll copy the first directory's contents into the second directory. + +run_test_build.sh +~~~~~~~~~~~~~~~~~ +This is a script internally calling update_cvs and build_toolchain trying +to build a complete toolchain. It'll keep the build log (be it successful +or not) into a given location and send out an email to report it's work. +I call it from CRON like this: + + /home/jbglaw/vax/checkout/toolchain/scripts/run_test_build.sh \ + vax-linux-uclibc \ + /tmp/build-temp-vax-linux \ + /home/jbglaw/vax/checkout/toolchain/scripts/vax_toolchain_config \ + 'jb...@lu...' \ + /tmp/build.ack \ + /tmp/build.nack \ + /tmp/build.running + --- NEW FILE: run_test_build.sh --- #!/bin/sh if [ $# -ne 7 ]; then echo "$0 target /path/to/build-directory /path/to/vax_toolchain_config ma...@ad... /path/to/build.okay /path/to/build.not-okay /path/to/lockfile" >&2 echo "" >&2 echo "target -- Something like vax-linux or vax-linux-uclibc" >&2 echo "/path/to/build-directory -- This is where all the stuff is build in, /tmp/vax-linux would be a nice name." >&2 echo "/path/to/vax_toolchain_config -- File containing various settings" >&2 echo "ma...@ad... -- Email address/addresses to send result to. Beware, this is _one_ argument, use quotes" >&2 echo "/path/to/build.okay -- Location to save the build.log to IFF the build went okay" >&2 echo "/path/to/build.not-okay -- Location to save the build.log to IFF the build was unsuccessful" >&2 echo "/path/to/build.not-okay -- Location to save the build.log to IFF the build was unsuccessful" >&2 echo "/path/to/lockfile -- GLOBAL lockfile for CVS/SVN updates and ALL and ANY builds" >&2 exit 1 fi TARGET="${1}" BUILD_DIRECTORY="${2}" SOURCE_FILE="${3}" SEND_MAIL_TO="${4}" BUILD_OKAY="${5}" BUILD_BAD="${6}" LOCKFILE="${7}" # # $1: Subject # function send_stdin() { mail -s "$1" ${SEND_MAIL_TO} } function lock_down() { if [ -f "${LOCKFILE}" ]; then ( echo "Hello!" echo "" echo "Unfortunately, the lock file (${LOCKFILE})" echo "is already (or still) there so I'll abort and try" echo "again later. Maybe that'll work." echo "" echo "If you continue to get this message, please check" echo "if the lockfile is stale and remove it if neccessary." echo "" echo "Thanks," echo " Your automatic buildscript" echo "" ) | send_stdin "Found lockfile" exit 1 else touch "${LOCKFILE}" fi } function unlock() { rm -rf "${BUILD_DIRECTORY}" rm -f "${LOCKFILE}" } function update_sources() { return 0 if ! OUTPUT="`update_upstream_cvs_sandboxes.sh 2>&1`"; then ( echo "Hello!" echo "" echo "Seems updating the source code failed. I'll try" echo "again later on, but for reference, here are the" echo "last 30 lines of my attempt:" echo "" echo "================== 8< -------------------------" echo "${OUTPUT}" | tail -n 30 echo "------------------ >8 =========================" echo "" echo "Thanks," echo " Your automatic buildscript" echo "" ) | send_stdin "Updating sources failed" unlock exit 1 fi } . "${SOURCE_FILE}" lock_down update_sources if build_toolchain.sh --base "${BUILD_DIRECTORY}" --log-to-file "${TARGET}" > /dev/null 2>&1; then # Build is okay ( echo "Hello!" echo "" echo "Seems building for target ${TARGET} worked well," echo "so here's the difference of the build log, if any:" echo "" echo "================== 8< -------------------------" compare_buildlog.sh "${BUILD_OKAY}" "${BUILD_DIRECTORY}/build.log" echo "------------------ >8 =========================" echo "" echo "Have a nice day," echo " Your automatic buildscript" echo "" ) | send_stdin "Successful build for ${TARGET}" mv "${BUILD_DIRECTORY}/build.log" "${BUILD_OKAY}" unlock exit 0 else # Build fucked up ( echo "Hello!" echo "" echo "Seems building for target ${TARGET} failed :-(" echo "Here's the difference of the build log of the last" echo "known-successful build:" echo "" echo "================== 8< -------------------------" compare_buildlog.sh "${BUILD_OKAY}" "${BUILD_DIRECTORY}/build.log" echo "------------------ >8 =========================" echo "" echo "Have a nice day," echo " Your automatic buildscript" echo "" ) | send_stdin "Failed build for ${TARGET}" mv "${BUILD_DIRECTORY}/build.log" "${BUILD_BAD}" unlock exit 1 fi |