diff options
author | Thorsten Behrens <tbehrens@novell.com> | 2011-02-28 17:34:27 +0100 |
---|---|---|
committer | Thorsten Behrens <tbehrens@novell.com> | 2011-02-28 17:34:27 +0100 |
commit | ec8d440f7ff08b6d5faed2e6da4655866c469f85 (patch) | |
tree | 439da1331c33f43a6e191aa206f231da1981a5ed /bin | |
parent | 29b55434cb4c5816a2d2f4544e733edfc9f1fea8 (diff) |
Removed tinbuild script
tinbuild is now maintained in a separate repo:
http://cgit.freedesktop.org/libreoffice/contrib/buildbot/
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/tinbuild | 313 |
1 files changed, 0 insertions, 313 deletions
diff --git a/bin/tinbuild b/bin/tinbuild deleted file mode 100755 index b4c380079ea9..000000000000 --- a/bin/tinbuild +++ /dev/null @@ -1,313 +0,0 @@ -#!/bin/sh - -export LC_ALL="C" - -## default config -PAUSE_SECONDS=$((15*60)) -HTML_OUTPUT=0 -SEND_MAIL=0 -NICE= -OWNER= -MACHINE=`uname` -TINDERNAME= - -SMTPPORT=25 -SMTPCRYPT=none -SMTPHOST= -SMTPUSER= -SMTPPW= - -## subroutines -usage () -{ - echo "Usage: $0 [options]" - echo "Options:" - echo "-h this help" - echo "-i run with ionice -c3, can be combined with -n" - echo "-l write html build log" - echo "-m <owner> mail errors to the committer, general errors to the <owner>" - echo "-n run with nice, can be combined with -i" - echo "-s <host> SMTP server" - echo "-c <type> SMTP crypt to use - either none, tls or ssl" - echo "-u <user> SMTP user name for auth login" - echo "-p <pass> SMTP password for auth login" - echo "-t <name> send tinderbox mails, identify self as <name>" - echo "-w <N> specify timeout in secs between subsequent pull requests" -} - -getCommitters () -{ - from_date="$1" - - ./g -s log '--pretty=tformat:%ce' --after="$from_date" | sort | uniq | tr '\n' ',' -} - -sendMailMsg () -{ - TO="$1" - SUBJECT="$2" - HEADERS="$3" - BCC="$4" - LOG="$5" - echo $BCC - perl -e " -use MIME::Lite; - -my \$text; -while (<>) { - \$text .= \$_; -} - -\$msg = MIME::Lite->new( - From => '$OWNER', - To => '$TO', - Subject => '$SUBJECT', - Type => 'TEXT', - Data => \$text - $HEADERS -) or die \"Error creating multipart container: \$!\n\"; - -if ('$LOG' ne '' && -f '$LOG') { - \$msg->attach ( - Type => 'application/x-gzip', - Path => '$LOG', - Filename => '$LOG', - Disposition => 'attachment' - ) or die \"Error adding $LOG: \$!\n\"; -} - -my \$smtp_class = '$SMTPCRYPT' eq 'none' ? - 'Net::SMTP' : - '$SMTPCRYPT' eq 'ssl' ? 'Net::SMTP::SSL' : 'Net::SMTP::TLS'; -eval \"use \$smtp_class\"; -my \$SMTP = \$smtp_class->new( - '$SMTPHOST', - Hello => 'documentfoundation.org', - Port => '$SMTPPORT', - User => '$SMTPUSER', - Password => '$SMTPPW' ); -die \"Cannot connect to SMTP server!\" unless defined \$SMTP; - -\$SMTP->mail('$OWNER'); -\$SMTP->to('$TO'); -\$SMTP->bcc('$BCC') if ('$BCC' ne ''); -\$SMTP->data(); -\$SMTP->datasend( \$msg->as_string() ); -\$SMTP->dataend(); -\$SMTP->quit(); - -print 'Sent a mail to \"$TO\" with subject \"$SUBJECT\".' . \"\n\"; -" -} - -reportError () -{ - error_kind="$1" - shift - - rough_time="$1" - shift - - to_mail= - if test "$SEND_MAIL" -eq 1; then - case "$error_kind" in - owner) to_mail="$OWNER" - message="box broken" ;; - *) if test -z "$last_success" ; then - # we need at least one successful build to - # be reliable - to_mail="$OWNER" - else - to_mail=`getCommitters "$last_success"` - fi - message="last success: $rough_time" ;; - esac - fi - - echo "$*" 1>&2 - echo "Last success: $rough_time" 1>&2 - if test -n "$to_mail" ; then - TINDER1= - TINDER2= - if test "$SEND_MAIL" -eq 1 -a -n "$TINDERNAME" ; then - TINDER1="`echo 'Full log available at http://tinderbox.go-oo.org/MASTER/status.html'`" - TINDER2="`echo \"Box name: $TINDERNAME\"`" - fi - cat <<EOF | sendMailMsg "$to_mail" "Tinderbox failure, $message" "" "$OWNER" -Hi folks, - -One of you broke the build of LibreOffice master with your commit :-( -Please commit and push a fix ASAP! - -${TINDER1} - -Tinderbox info: - - ${TINDER2} - Machine: `uname -a` - Configured with: `cat autogen.lastrun` - -Commits since the last success: - -`./g log '--pretty=tformat:%h %s' --after="$last_success" | sed 's/^/ /'` - -The error is: - -$* -EOF - else - echo "$*" 1>&2 - if test "$error_kind" = "owner" ; then - exit 1 - fi - fi -} - -gitHeads () -{ - ./g rev-parse --verify HEAD -} - -currentTime () -{ - if [ "X$MACHINE" == "XDarwin" ] ; then - date -u '+%Y-%m-%d %H:%M:%S' - else - date --utc --rfc-3339=seconds - fi -} - -sendTinderboxLog () -{ - if test "$SEND_MAIL" -ne 1 -o -z "$TINDERNAME" ; then - return 0 - fi - - STARTTIME="$1" - STATUS="$2" - LOG="$3" - - XTINDER=",'X-Tinder:'=>'cookie'" - GZLOG= - MESSAGE=" -tinderbox: administrator: $OWNER -tinderbox: buildname: $TINDERNAME -tinderbox: tree: MASTER -tinderbox: starttime: `date '+%s' -d \"$STARTTIME\"` -tinderbox: timenow: `date '+%s'` -tinderbox: errorparser: unix -tinderbox: status: $STATUS -tinderbox: END -" - - if [ "$LOG" = "yes" ] ; then - GZLOG="tinder.log.gz" - ( echo "$MESSAGE" ; cat autogen.log clean.log build.log smoketest.log install.log 2>/dev/null ) | gzip -c > "$GZLOG" - XTINDER=",'X-Tinder:'=>'gzookie'" - fi - - echo "$MESSAGE" | sendMailMsg "tinderbox@gimli.documentfoundation.org" "tinderbox gzipped logfile" "$XTINDER" "" "$GZLOG" -} - -## code -while getopts hilm:ns:c:u:p:t:w: opt ; do - case "$opt" in - h) usage; exit ;; - i) NICE="$NICE ionice -c3" ;; - l) HTML_OUTPUT=1 ;; - m) SEND_MAIL=1 ; OWNER="$OPTARG" ;; - n) NICE="$NICE nice" ;; - s) SMTPHOST="$OPTARG" ;; - c) SMTPCRYPT="$OPTARG" ;; - u) SMTPUSER="$OPTARG" ;; - p) SMTPPW="$OPTARG" ;; - t) TINDERNAME="$OPTARG" ;; - w) PAUSE_SECONDS="$OPTARG" ;; - ?) usage; exit ;; - esac -done - -# sanity checks -which git > /dev/null 2>&1 || { - echo "You need git for this!" - exit 1 -} - -if test "$SEND_MAIL" -eq 1 ; then - if test -z "$OWNER" ; then - echo "Owner not set." - exit 1 - fi - if test -z "$SMTPHOST" ; then - echo "SMTP server not set." - exit 1 - fi - if test "$OWNER" = `echo ${OWNER} | sed 's/\@/_/g'` ; then - echo "The owner address '$OWNER' does not look like an email address." - exit 1 - fi -fi - -# for build.pl -test $HTML_OUTPUT -eq 1 && export BUILD_HTML_OUTPUT=true - -# main -prev_success="" -last_success="" -while true; do - err_msg="" - - # cleanup - $NICE make clean - - # FIXME we need a more exact way to determine a 'good' date; this is not accurate - rough_checkout_date="`currentTime`" - sendTinderboxLog "$rough_checkout_date" "building" - - # try to build - build_status="build_failed" - if ! $NICE ./autogen.sh >autogen.log 2>&1 ; then - reportError committer "$rough_checkout_date" `printf "autogen.sh / configure failed - error is:\n\n"` "$(cat autogen.log)" - elif ! $NICE make clean >clean.log 2>&1 ; then - reportError committer "$rough_checkout_date" `printf "cleaning up failed - error is:\n\n"` "$(tail -n100 clean.log)" - elif ! $NICE make >build.log 2>&1 ; then - reportError committer "$rough_checkout_date" `printf "building failed - error is:\n\n"` "$(tail -n100 build.log)" -# elif ! $NICE make smoketest > smoketest.log 2>&1 ; then -# reportError committer "$rough_checkout_date" `printf "smoketest failed - error is:\n\n"` "$(tail -n100 smoketest.log)" - elif ! $NICE make dev-install >install.log 2>&1 ; then - reportError committer "$rough_checkout_date" `printf "dev installation failed - error is:\n\n"` "$(tail -n100 install.log)" - else - echo "Build done - checkout from $rough_checkout_date successful." - gitHeads > prev-git-heads.txt - - prev_success=$last_success - last_success=$rough_checkout_date - build_status="success" - fi - - # send tinderbox mail - sendTinderboxLog "$rough_checkout_date" "$build_status" "yes" - - # save the old logs - for I in autogen.log clean.log build.log smoketest.log install.log ; do - mv $I prev-$I 2>/dev/null - done - - echo updating repo - - # new commits? - while true; do - old_head=$(gitHeads) && err_msg="$(./g pull -r 2>&1)" || - { - reportError owner "$rough_checkout_date" `printf "git repo broken - error is:\n\n$err_msg"` - } - new_head=$(gitHeads) - - if test "$old_head" != "$new_head"; then - break - fi - - echo "Waiting $PAUSE_SECONDS seconds." - sleep $PAUSE_SECONDS - done -done |