#!/bin/sh # # Pavel's build - build infrastructure tools # # (c) Pavel Janík , 2007 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # BUILDSERVICE_HOST=paveljanik.int.rudna.net # # Emit BUILD MESSAGE, e.g.: # # BUILD MESSAGE (INFO): Build phase CONFIGURE finished successfully. BuildMessage() { date -u echo "BUILD MESSAGE ($1): $2" # Send the build message to the build server if we have build ID [ ! -z ${BUILDID} ] && BuildSendBuildMessage "$1 $2" } # # This function is called at the beginning of every build phase. # # $1 contains the name of the build phase to begin BuildPhaseStarted() { BuildMessage "INFO" "Build phase $1 started." } BuildInfo() { BuildMessage "BUILD" "${VERSION} ${BUILD_IDENTIFICATION} ${SUPPORTEDLANGUAGES}" } # # This function is called after successful finishing of the build # phase. # # $1 contains the name of the build phase just finished BuildPhaseFinished() { BuildMessage "INFO" "Build phase $1 finished successfully." } # # This function is called after error in the build phase. # # $1 contains the name of the build phase just finished # $2 contains the message describing the error BuildPhaseError() { BuildMessage "ERROR" "Build phase $1 not finished: $2!" exit -1 } # # This function is called to print warning in the build phase. # # $1 contains the name of the build phase just finished # $2 contains the warning message BuildPhaseWarning() { BuildMessage "WARNING" "Build phase $1: $2." } BuildInit() { # Read user's machine ID [ -f ~/.OpenOffice.org-machine-ID ] && MACHINEID=`cat ~/.OpenOffice.org-machine-ID` # Read this particular build directory instance's machine ID [ -f .OpenOffice.org-machine-ID ] && MACHINEID=`cat .OpenOffice.org-machine-ID` export MACHINEID [ ! -z ${MACHINEID} ] && BuildRequestBuildID echo Machine ID is: $MACHINEID echo Build ID is: $BUILDID BuildMessage "BUILD" "STARTED" } BuildFinished() { BuildMessage "BUILD" "FINISHED" } # FIXME: ... BuildRequestBuildID() { cat </dev/null >BUILDID ${MACHINEID} password EOF [ -f BUILDID ] && BUILDID=`cat BUILDID` export BUILDID } # FIXME: ... BuildSendBuildMessage() { MESSAGE=$1 ( # Hack: OOo's internal curl is built without openssl... 8) unset LD_LIBRARY_PATH cat </dev/null ${MACHINEID} password ${BUILDID} ${MESSAGE} EOF ) }