cron-script.sh
author laca
Fri, 18 Jul 2003 01:55:09 +0000
changeset 646 79a4079b3cab
parent 644 f9dc5b6a3cb2
child 647 116c76d09aa5
permissions -rwxr-xr-x
*** empty log message ***
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
482
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
     1
#!/bin/bash
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
     2
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
     3
SPECDIR=/gnome/spec-files
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
     4
RHOST=blader
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
     5
RUSER=gbuild
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
     6
RPMSDIR=/sgnome/pkgs/gnome-2.2/rpms/nightly
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
     7
SRPMSDIR=/sgnome/pkgs/gnome-2.2/srpms/nightly
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
     8
[email protected]
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
     9
[email protected]
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    10
DATE_FMT="%y%m%d"
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    11
MYNAME="$0"
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    12
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    13
clean_up () {
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    14
  case "$MYNAME" in
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    15
  /tmp/cron-script.copy.* )
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    16
        rm -f $MYNAME
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    17
        ;;
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    18
  esac
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    19
}
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    20
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    21
trap clean_up HUP INT TERM QUIT EXIT
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    22
485
e7fdca492320 *** empty log message ***
laca
parents: 484
diff changeset
    23
case "$MYNAME" in
e7fdca492320 *** empty log message ***
laca
parents: 484
diff changeset
    24
    /tmp/cron-script.copy.* )
e7fdca492320 *** empty log message ***
laca
parents: 484
diff changeset
    25
        ;;
e7fdca492320 *** empty log message ***
laca
parents: 484
diff changeset
    26
    *)
482
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    27
        cp $MYNAME /tmp/cron-script.copy.$$
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    28
        chmod 755 /tmp/cron-script.copy.$$
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    29
        cd /tmp
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    30
        exec /tmp/cron-script.copy.$$
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    31
        ;;
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    32
esac
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    33
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    34
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    35
DATE=`date +$DATE_FMT`
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    36
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    37
fatal_error () {
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    38
  echo "ERROR: $*"
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    39
  exit 1
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    40
}
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    41
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    42
cd $SPECDIR || fatal_error "$SPECDIR not found"
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    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
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    45
608
7e58689b0c2d more typos...
laca
parents: 607
diff changeset
    46
if ! /usr/bin/cmp -s ./cron-script.sh $MYNAME; then exec ./cron-script.sh; fi
482
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    47
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    48
rm -f GNOME*Template*.spec
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    49
484
14ebefcf083e remove pkgs quietly
laca
parents: 482
diff changeset
    50
./build-gnome2 -q uninstall-pkgs *.spec
482
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    51
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    52
rm -f /usr/src/packages/SRPMS/* /usr/src/packages/RPMS/*/*
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    53
609
b705c778bcb2 build report fixes
laca
parents: 608
diff changeset
    54
WEBROOT=/scde/web/docs
b705c778bcb2 build report fixes
laca
parents: 608
diff changeset
    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
79a4079b3cab *** empty log message ***
laca
parents: 644
diff changeset
    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
ffc39a2f2880 add missing \
laca
parents: 606
diff changeset
    59
./build-gnome2 -v --nightly --date "$DATE" build *.spec \
609
b705c778bcb2 build report fixes
laca
parents: 608
diff changeset
    60
        --logdir=$WEBROOT/$LOGDIR \
b705c778bcb2 build report fixes
laca
parents: 608
diff changeset
    61
        --logdir-url=`date +%Y-%m-%d` \
b705c778bcb2 build report fixes
laca
parents: 608
diff changeset
    62
        --summary-log=$WEBROOT/$LOGDIR.html \
608
7e58689b0c2d more typos...
laca
parents: 607
diff changeset
    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
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    68
581
dbc6e8f701a4 *** empty log message ***
laca
parents: 485
diff changeset
    69
echo '' | rsh $RHOST -l $RUSER "rm -f $RPMSDIR/*"
dbc6e8f701a4 *** empty log message ***
laca
parents: 485
diff changeset
    70
echo '' | rcp `./build-gnome2 --nightly --date "$DATE" install-order --full-path \
482
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    71
    *.spec` $RUSER@$RHOST:$RPMSDIR
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    72
581
dbc6e8f701a4 *** empty log message ***
laca
parents: 485
diff changeset
    73
echo '' | rsh $RHOST -l $RUSER "rm -f $SRPMSDIR/*"
dbc6e8f701a4 *** empty log message ***
laca
parents: 485
diff changeset
    74
echo '' | rcp /usr/src/packages/SRPMS/*.$DATE.src.rpm \
482
0b7e38d38dac added laca's build scripts
laca
parents:
diff changeset
    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
b705c778bcb2 build report fixes
laca
parents: 608
diff changeset
    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
f9dc5b6a3cb2 build report fixes
laca
parents: 609
diff changeset
    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