author | laca |
Fri, 18 Jul 2003 01:55:09 +0000 | |
changeset 646 | 79a4079b3cab |
parent 644 | f9dc5b6a3cb2 |
child 647 | 116c76d09aa5 |
permissions | -rwxr-xr-x |
482 | 1 |
#!/bin/bash |
2 |
||
3 |
SPECDIR=/gnome/spec-files |
|
4 |
RHOST=blader |
|
5 |
RUSER=gbuild |
|
6 |
RPMSDIR=/sgnome/pkgs/gnome-2.2/rpms/nightly |
|
7 |
SRPMSDIR=/sgnome/pkgs/gnome-2.2/srpms/nightly |
|
8 |
[email protected] |
|
9 |
[email protected] |
|
10 |
DATE_FMT="%y%m%d" |
|
11 |
MYNAME="$0" |
|
12 |
||
13 |
clean_up () { |
|
14 |
case "$MYNAME" in |
|
15 |
/tmp/cron-script.copy.* ) |
|
16 |
rm -f $MYNAME |
|
17 |
;; |
|
18 |
esac |
|
19 |
} |
|
20 |
||
21 |
trap clean_up HUP INT TERM QUIT EXIT |
|
22 |
||
485 | 23 |
case "$MYNAME" in |
24 |
/tmp/cron-script.copy.* ) |
|
25 |
;; |
|
26 |
*) |
|
482 | 27 |
cp $MYNAME /tmp/cron-script.copy.$$ |
28 |
chmod 755 /tmp/cron-script.copy.$$ |
|
29 |
cd /tmp |
|
30 |
exec /tmp/cron-script.copy.$$ |
|
31 |
;; |
|
32 |
esac |
|
33 |
||
34 |
||
35 |
DATE=`date +$DATE_FMT` |
|
36 |
||
37 |
fatal_error () { |
|
38 |
echo "ERROR: $*" |
|
39 |
exit 1 |
|
40 |
} |
|
41 |
||
42 |
cd $SPECDIR || fatal_error "$SPECDIR not found" |
|
43 |
||
606
53d75f521e46
added some command line options to the build script for use in the nightly builds.
laca
parents:
581
diff
changeset
|
44 |
cvs -q up -Pd > /dev/null 2>&1 || fatal_error "CVS update failed" |
482 | 45 |
|
608 | 46 |
if ! /usr/bin/cmp -s ./cron-script.sh $MYNAME; then exec ./cron-script.sh; fi |
482 | 47 |
|
48 |
rm -f GNOME*Template*.spec |
|
49 |
||
484 | 50 |
./build-gnome2 -q uninstall-pkgs *.spec |
482 | 51 |
|
52 |
rm -f /usr/src/packages/SRPMS/* /usr/src/packages/RPMS/*/* |
|
53 |
||
609 | 54 |
WEBROOT=/scde/web/docs |
55 |
WEBDIR=gnome/releng/2.2/mercury/nightly |
|
606
53d75f521e46
added some command line options to the build script for use in the nightly builds.
laca
parents:
581
diff
changeset
|
56 |
LOGDIR=$WEBDIR/`date +%Y-%m-%d` |
646 | 57 |
mkdir -p $WEBDIR/$LOGDIR |
606
53d75f521e46
added some command line options to the build script for use in the nightly builds.
laca
parents:
581
diff
changeset
|
58 |
|
607 | 59 |
./build-gnome2 -v --nightly --date "$DATE" build *.spec \ |
609 | 60 |
--logdir=$WEBROOT/$LOGDIR \ |
61 |
--logdir-url=`date +%Y-%m-%d` \ |
|
62 |
--summary-log=$WEBROOT/$LOGDIR.html \ |
|
608 | 63 |
--summary-title="Nightly Build Report `date +'%d %B %Y'`" \ |
606
53d75f521e46
added some command line options to the build script for use in the nightly builds.
laca
parents:
581
diff
changeset
|
64 |
--rpm-url=file:///net/dtserv1.ireland/dtserv1/sgnome/buildenv/sgnome/pkgs/gnome-2.2/rpms/nightly \ |
53d75f521e46
added some command line options to the build script for use in the nightly builds.
laca
parents:
581
diff
changeset
|
65 |
--srpm-url=file:///net/dtserv1.ireland/dtserv1/sgnome/buildenv/sgnome/pkgs/gnome-2.2/srpms/nightly > /tmp/build.log.$$ 2>&1 |
53d75f521e46
added some command line options to the build script for use in the nightly builds.
laca
parents:
581
diff
changeset
|
66 |
|
53d75f521e46
added some command line options to the build script for use in the nightly builds.
laca
parents:
581
diff
changeset
|
67 |
FAILED=$? |
482 | 68 |
|
581 | 69 |
echo '' | rsh $RHOST -l $RUSER "rm -f $RPMSDIR/*" |
70 |
echo '' | rcp `./build-gnome2 --nightly --date "$DATE" install-order --full-path \ |
|
482 | 71 |
*.spec` $RUSER@$RHOST:$RPMSDIR |
72 |
||
581 | 73 |
echo '' | rsh $RHOST -l $RUSER "rm -f $SRPMSDIR/*" |
74 |
echo '' | rcp /usr/src/packages/SRPMS/*.$DATE.src.rpm \ |
|
482 | 75 |
$RUSER@$RHOST:$SRPMSDIR |
606
53d75f521e46
added some command line options to the build script for use in the nightly builds.
laca
parents:
581
diff
changeset
|
76 |
|
609 | 77 |
ALL_REPORTS=$WEBROOT/$WEBDIR/all_reports.html |
606
53d75f521e46
added some command line options to the build script for use in the nightly builds.
laca
parents:
581
diff
changeset
|
78 |
touch $ALL_REPORTS |
53d75f521e46
added some command line options to the build script for use in the nightly builds.
laca
parents:
581
diff
changeset
|
79 |
|
53d75f521e46
added some command line options to the build script for use in the nightly builds.
laca
parents:
581
diff
changeset
|
80 |
cp $ALL_REPORTS $ALL_REPORTS.old |
53d75f521e46
added some command line options to the build script for use in the nightly builds.
laca
parents:
581
diff
changeset
|
81 |
export FAILED ALL_REPORTS |
53d75f521e46
added some command line options to the build script for use in the nightly builds.
laca
parents:
581
diff
changeset
|
82 |
|
644 | 83 |
( echo "<TR><TD><A HREF=/$LOGDIR.html>`date +%Y-%m-%d`</A></TD>"; \ |
606
53d75f521e46
added some command line options to the build script for use in the nightly builds.
laca
parents:
581
diff
changeset
|
84 |
echo " <TD>$FAILED package(s) failed</TD></TR>"; \ |
53d75f521e46
added some command line options to the build script for use in the nightly builds.
laca
parents:
581
diff
changeset
|
85 |
cat $ALL_REPORTS.old ) > $ALL_REPORTS |
53d75f521e46
added some command line options to the build script for use in the nightly builds.
laca
parents:
581
diff
changeset
|
86 |
|
53d75f521e46
added some command line options to the build script for use in the nightly builds.
laca
parents:
581
diff
changeset
|
87 |
cat /tmp/build.log.$$ | \ |
53d75f521e46
added some command line options to the build script for use in the nightly builds.
laca
parents:
581
diff
changeset
|
88 |
mail -s "mercury nightly build: $FAILED pkgs failed" \ |
53d75f521e46
added some command line options to the build script for use in the nightly builds.
laca
parents:
581
diff
changeset
|
89 |
-R $REPLY_TO $EMAIL_ADDR |
53d75f521e46
added some command line options to the build script for use in the nightly builds.
laca
parents:
581
diff
changeset
|
90 |
|
53d75f521e46
added some command line options to the build script for use in the nightly builds.
laca
parents:
581
diff
changeset
|
91 |
rm -f /tmp/build.log.$$ |
53d75f521e46
added some command line options to the build script for use in the nightly builds.
laca
parents:
581
diff
changeset
|
92 |
|
53d75f521e46
added some command line options to the build script for use in the nightly builds.
laca
parents:
581
diff
changeset
|
93 |
exit 0 |