geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r608198 - /geronimo/gbuild/daily_build_scripts/gbuild.sh
Date Wed, 02 Jan 2008 19:37:36 GMT
Author: gawor
Date: Wed Jan  2 11:37:34 2008
New Revision: 608198

URL: http://svn.apache.org/viewvc?rev=608198&view=rev
Log:
create unqiue mail files so that the right messages are sent to the right destinations

Modified:
    geronimo/gbuild/daily_build_scripts/gbuild.sh

Modified: geronimo/gbuild/daily_build_scripts/gbuild.sh
URL: http://svn.apache.org/viewvc/geronimo/gbuild/daily_build_scripts/gbuild.sh?rev=608198&r1=608197&r2=608198&view=diff
==============================================================================
--- geronimo/gbuild/daily_build_scripts/gbuild.sh (original)
+++ geronimo/gbuild/daily_build_scripts/gbuild.sh Wed Jan  2 11:37:34 2008
@@ -55,6 +55,18 @@
 
 export PATH=$JRE_HOME/bin:$JAVA_HOME/bin:$MVN_HOME/bin:$PATH
 
+
+function send_mail() {
+   subject=$1
+   mailto=$2
+
+   mail_ts=`date +%Y%m%d%H%M%S`
+   remote_mail_file=/home/prasad/${mail_ts}.mail.txt
+   scp mail.txt prasad@people:$remote_mail_file
+   ssh prasad@people "mail -s '$subject' $mailto < $remote_mail_file"
+}
+
+
 echo `date` > $BASE_DIR/date.log
 
 # check if another gbuild script is still running
@@ -65,8 +77,8 @@
   echo "Previous build is still running..." 
   subject="[BUILD] ${BRANCH_ID}: Previous build did not complete"
   echo "Previous build is still running..." > mail.txt
-  scp mail.txt prasad@people:/home/prasad
-  ssh prasad@people "mail -s '$subject' $ADMIN_ADDR < mail.txt"
+
+  send_mail "$subject" "$ADMIN_ADDR"
   exit
 fi
 
@@ -125,10 +137,9 @@
       subject="[BUILD] ${BRANCH_ID}: Failed for $rev"
       mailto="dev@geronimo.apache.org"
    fi
-   scp mail.txt prasad@people:/home/prasad
-   ssh prasad@people "mail -s '$subject' $mailto < mail.txt"
-}
 
+   send_mail "$subject" "$mailto"
+}
 
 build $SKIP_TESTS
 scp $log prasad@people:$bin_dir



Mime
View raw message