source: /cluster/svnroot/bccd-ng/branches/fitz-devel/bin/auto_build_wrapper.sh @ 2619

Last change on this file since 2619 was 2619, checked in by fitz, 10 years ago

merging from trunk

  • Property svn:executable set to *
File size: 2.5 KB
Line 
1#!/bin/bash -x
2
3if [ -z "$1" ]; then
4        echo "Need to put in database user!"
5        exit 1
6fi
7
8DBUSER=$1
9
10TEMPDIR=`mktemp -d`
11if [ "$?" -ne "0" ]; then
12        echo "mktemp -d died on $?"
13        exit $?
14fi
15
16pushd $TEMPDIR
17if [ "$?" -ne "0" ]; then
18        echo "pushd $TEMPDIR died on $?"
19        exit $?
20fi
21
22WEBSVN="http://bccd-ng.cluster.earlham.edu/svn/bccd-ng/"
23BRANCH="${WEBSVN}/trunk/"
24BINDIR="/bin/"
25BLDCD="build_livecd.pl"
26LOCALPERL=${TEMPDIR}/site_perl/
27PERL5LIB=${PERL5LIB}:${LOCALPERL}
28PATH=$PATH:/sbin:/usr/sbin
29OUTBASE=/cluster/bccd-ng/stable
30OUTISO=$OUTBASE/bccd_latest.iso
31TEMPISO=`mktemp ${OUTISO}.XXXXXXXX`
32
33export PERL5LIB
34
35CMD="wget -q -c ${BRANCH}/${BINDIR}/${BLDCD}"
36$CMD
37RC=$?
38if [ "$RC" -ne "0" ]; then
39        echo "$CMD died on $RC"
40        exit $RC
41fi
42
43CMD="chmod 755 $BLDCD"
44$CMD
45RC=$?
46if [ "$RC" -ne "0" ]; then
47        echo "$CMD died on $RC"
48        exit $RC
49fi
50
51CMD="mkdir -p ${LOCALPERL}/Bccd/"
52$CMD
53RC=$?
54if [ "$RC" -ne "0" ]; then
55        echo "$CMD died on $RC"
56        exit $RC
57fi
58
59CMD="wget -q -O ${LOCALPERL}/Bccd.pm -c ${BRANCH}/trees/usr/local/lib/site_perl/5.10.0/Bccd.pm"
60$CMD
61RC=$?
62if [ "$RC" -ne "0" ]; then
63        echo "$CMD died on $RC"
64        exit $RC
65fi
66
67CMD="wget -q -O ${LOCALPERL}/Bccd/TestDb.pm -c ${BRANCH}/trees/usr/local/lib/site_perl/5.10.0/Bccd/TestDb.pm"
68$CMD
69RC=$?
70if [ "$RC" -ne "0" ]; then
71        echo "$CMD died on $RC"
72        exit $RC
73fi
74
75CMD="/usr/bin/touch ${TEMPISO}"
76$CMD
77RC=$?
78if [ "$RC" -ne "0" ]; then
79        echo "$CMD died on $RC"
80        exit $RC
81fi
82
83CMD="/bin/chmod 600 ${TEMPISO}"
84$CMD
85RC=$?
86if [ "$RC" -ne "0" ]; then
87        echo "$CMD died on $RC"
88        exit $RC
89fi
90
91CMD="./$BLDCD --arch i386 --suite lenny --outiso ${TEMPISO} --updatedb $DBUSER"
92$CMD
93RC=$?
94if [ "$RC" -ne "0" ]; then
95        echo "$CMD died on $RC"
96        exit $RC
97fi
98
99# No $CMD for redirect
100pushd $OUTBASE
101/usr/bin/md5sum `basename ${TEMPISO}` > ${TEMPISO}.md5
102RC=$?
103if [ "$RC" -ne "0" ]; then
104    echo "/usr/bin/md5sum ${TEMPISO} > ${TEMPISO}.md5 died on $RC"
105    exit $RC
106fi
107popd
108
109CMD="/bin/rm -f ${OUTISO} ${OUTISO}.md5"
110$CMD
111RC=$?
112if [ "$RC" -ne "0" ]; then
113        echo "$CMD died on $RC"
114        exit $RC
115fi
116
117CMD="/bin/mv ${TEMPISO}.md5 ${OUTISO}.md5"
118$CMD
119RC=$?
120if [ "$RC" -ne "0" ]; then
121        echo "$CMD died on $RC"
122        exit $RC
123fi
124
125CMD="/bin/mv ${TEMPISO} ${OUTISO}"
126$CMD
127RC=$?
128if [ "$RC" -ne "0" ]; then
129        echo "$CMD died on $RC"
130        exit $RC
131fi
132
133CMD="/bin/chmod 644 ${OUTISO}"
134$CMD
135RC=$?
136if [ "$RC" -ne "0" ]; then
137        echo "$CMD died on $RC"
138        exit $RC
139fi
140
141/bin/sed -i -e 's/bccd_latest.iso.*/bccd_latest.iso/g' ${OUTISO}.md5
142CMD="/bin/chmod 644 ${OUTISO}.md5"
143$CMD
144RC=$?
145if [ "$RC" -ne "0" ]; then
146        echo "$CMD died on $RC"
147        exit $RC
148fi
149
150popd
151
152rm -fr $TEMPDIR
Note: See TracBrowser for help on using the repository browser.