/[CCFs]/bin/autobuild
ViewVC logotype

Contents of /bin/autobuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations)
Mon Feb 2 14:46:25 2015 UTC (9 years, 10 months ago) by ccflib
Branch: MAIN
Changes since 1.7: +4 -4 lines
Slight modifications to mail

1 #! /bin/bash
2 #
3 # + fetch new CCF deliveries
4 # + build latest files
5 # + move new files to CCF repository
6 #
7 # $Id: autobuild,v 1.7 2015/02/02 14:29:33 ccflib Exp $
8 #
9
10 . $HOME/bin/ccflib.cfg
11
12 ##echo $me running on `date`
13 export PATH=$HOME/bin:$PATH
14 me=`basename $0`
15 LOG=$HOME/autobuild.log
16 exec 2>&1
17 exec 1>$LOG
18
19 LOCK=$HOME/autobuild.lck
20 unlock () {
21 rm -f $LOCK
22 }
23
24 count=0
25 maxcount=10
26 trap unlock EXIT
27
28 while [ -e $LOCK -a $count -lt $maxcount ] ; do
29 count=$[count + 1]
30 echo $me: $LOCK exists. Sleeping 60s [$count]
31 sleep 60
32 done
33 if [ $count -lt $maxcount ] ; then
34 touch $LOCK
35 # trap unlock EXIT
36 getdeliveries
37 buildlatest && acceptbuild
38 else
39 echo $me: $LOCK exists, and slept enough. Giving up.
40 exit 1
41 fi
42
43 # Notify by email using sendmail instead of via the cron job, so that
44 # it is possible to get a meaningful subject line
45 #
46 # The email initially went to ccflib@xmm.esac.esa.int where the procmailrc file
47 # copied it to xmm-it mailman mail list and stored it into a mailbox under ccflib
48 # directory ($HOME/Mail/....). However, this mail is only telling that autobuild was
49 # executed, in fact not even that but buildlatest. So, a change has been made in the
50 # ccflib procmailrc file to filter out these messages and sent only to the
51 # CCF Building system administrator (eduardo.ojero@esa.int).
52
53 if [ -s $LOG ] ; then
54 /usr/lib/sendmail -t <<EOF
55 To: ccflib@xmm.esac.esa.int
56 Subject: Run of autobuild at `hostname` - CCF build at `date`
57
58 * * * * * Only for the ccflib administrator eyes * * * * *
59
60 The following log was produced during the last run of autobuild:
61
62 `cat $LOG`
63
64 EOF
65 fi

  ViewVC Help
Powered by ViewVC 1.1.27