fix
[build.git] / vbuild-nightly.sh
1 #!/bin/bash
2 REVISION=$(echo '$Revision$' | sed -e 's,\$,,g' -e 's,^\w*:\s,,' )
3
4 COMMANDPATH=$0
5 COMMAND=$(basename $0)
6
7 # default values, tunable with command-line options
8 DEFAULT_FCDISTRO=centos5
9 DEFAULT_PLDISTRO=planetlab
10 DEFAULT_PERSONALITY=linux32
11 DEFAULT_BASE="@DATE@--@PLDISTRO@-@FCDISTRO@-@PERSONALITY@"
12 DEFAULT_build_SVNPATH="http://svn.planet-lab.org/svn/build/trunk"
13 DEFAULT_TESTCONFIG="default"
14 DEFAULT_IFNAME=eth0
15
16 # web publishing results
17 DEFAULT_WEBPATH="/build/@PLDISTRO@/"
18
19 # default gpg path used in signing yum repo
20 DEFAULT_GPGPATH="/etc/planetlab"
21 # default email to use in gpg secring
22 DEFAULT_GPGUID="root@$( /bin/hostname )"
23
24 # for the test part
25 DEFAULT_TESTBUILDURL="http://build.onelab.eu/"
26 TESTBOXSSH=root@testbox.onelab.eu
27 ####################
28 # assuming vserver runs in UTC
29 DATE=$(date +'%Y.%m.%d')
30
31 # temporary - wrap a quick summary of suspicious stuff
32 # this is to focus on installation that go wrong
33 # use with care, a *lot* of other things can go bad as well
34 function summary () {
35     from=$1; shift
36     echo "******************** BEG SUMMARY" 
37     python - $from <<EOF
38 #!/usr/bin/env python
39 # read a full log and tries to extract the interesting stuff
40
41 import sys,re
42 m_show_line=re.compile(".* BEG (RPM|VSERVER).*|.*'boot'.*|\* .*|.*is not installed.*|.*PROPFIND.*|.*Starting.*:runtest.*")
43 m_installing_any=re.compile('\r  (Installing:[^\]]*]) ')
44 m_installing_err=re.compile('\r  (Installing:[^\]]*])(..+)')
45 m_installing_end=re.compile('Installed:.*')
46 m_installing_doc1=re.compile("(.*)install-info: No such file or directory for /usr/share/info/\S+(.*)")
47 m_installing_doc2=re.compile("(.*)grep: /usr/share/info/dir: No such file or directory(.*)")
48
49 def summary (filename):
50
51     try:
52         if filename=="-":
53             filename="stdin"
54             f=sys.stdin
55         else:
56             f=open(filename)
57         echo=False
58         for line in f.xreadlines():
59             # first off : discard warnings related to doc
60             if m_installing_doc1.match(line):
61                 (begin,end)=m_installing_doc1.match(line).groups()
62                 line=begin+end
63             if m_installing_doc2.match(line):
64                 (begin,end)=m_installing_doc2.match(line).groups()
65                 line=begin+end
66             # unconditionnally show these lines
67             if m_show_line.match(line):
68                 print '>>>',line,
69             # an 'installing' line with messages afterwards : needs to be echoed
70             elif m_installing_err.match(line):
71                 (installing,error)=m_installing_err.match(line).groups()
72                 print '>>>',installing
73                 print '>>>',error
74                 echo=True
75             # closing an 'installing' section
76             elif m_installing_end.match(line):
77                 echo=False
78             # any 'installing' line
79             elif m_installing_any.match(line):
80                 if echo: 
81                     installing=m_installing_any.match(line).group(1)
82                     print '>>>',installing
83                 echo=False
84             # print lines when echo is true
85             else:
86                 if echo: print '>>>',line,
87         f.close()
88     except:
89         print 'Failed to analyze',filename
90
91 for arg in sys.argv[1:]:
92     summary(arg)
93 EOF
94     echo "******************** END SUMMARY" 
95 }
96
97
98 # Notify recipient of failure or success, manage various stamps 
99 function failure() {
100     set -x
101     mkdir -p ${WEBPATH}
102     cp $LOG ${WEBLOG}
103     summary $LOG >> ${WEBLOG}
104     (echo -n "============================== $COMMAND: failure at " ; date ; tail -c 30k $WEBLOG) > ${WEBLOG}.ko
105     if [ -n "$MAILTO" ] ; then
106         ( \
107             echo "See full build log at ${LOG_URL}" ; \
108             echo "and tail version at ${LOG_URL}.ko" ; \
109             echo "See complete set of testlogs at ${TESTLOGS_URL}" ; \
110             tail -c 30k ${WEBLOG} ) | mail -s "Failures for build ${BASE}" $MAILTO
111     fi
112     exit 1
113 }
114
115 function success () {
116     set -x
117     mkdir -p ${WEBPATH}
118     cp $LOG ${WEBLOG}
119     summary $LOG >> ${WEBLOG}
120     if [ -n "$DO_TEST" ] ; then
121         ( \
122             echo "Successfully built and tested" ; \
123             echo "See full build log at ${LOG_URL}" ; \
124             echo "See complete set of testlogs at ${TESTLOGS_URL}" ; \
125             ) > ${WEBLOG}.pass
126         rm -f ${WEBLOG}.ok ${WEBLOG}.ko
127     else
128         ( \
129             echo "Successfully built, no test requested" ; \
130             echo "See full build log at ${LOG_URL}" ; \
131             ) > ${WEBLOG}.ok
132     fi
133     if [ -n "$MAILTO" ] ; then
134         ( \
135             echo "$PLDISTRO ($BASE) build for $FCDISTRO completed on $(date)" ; \
136             echo "See full build log at ${LOG_URL}" ; \
137             [ -n "$DO_TEST" ] && echo "See complete set of testlogs at ${TESTLOGS_URL}" ) \
138             | mail -s "Successful build for ${BASE}" $MAILTO
139     fi
140     exit 0
141 }
142
143 # run in the vserver - do not manage success/failure, will be done from the root ctx
144 function build () {
145     set -x
146     set -e
147
148     echo -n "============================== Starting $COMMAND:build on "
149     date
150
151     cd /build
152   # if TAGSRELEASE specified : update PLDISTROTAGS with this tag
153     if [ -n "$TAGSRELEASE" ] ; then
154         svn up -r $TAGSRELEASE $PLDISTROTAGS
155     fi
156
157     show_env
158     
159     echo "Running make IN $(pwd)"
160     
161     # stuff our own variable settings
162     MAKEVARS=("PLDISTRO=${PLDISTRO}" "${MAKEVARS[@]}")
163     MAKEVARS=("PLDISTROTAGS=${PLDISTROTAGS}" "${MAKEVARS[@]}")
164     MAKEVARS=("build-SVNPATH=${build_SVNPATH}" "${MAKEVARS[@]}")
165     MAKEVARS=("PERSONALITY=${PERSONALITY}" "${MAKEVARS[@]}")
166     MAKEVARS=("MAILTO=${MAILTO}" "${MAKEVARS[@]}")
167
168     MAKEVARS=("BASE=${BASE}" "${MAKEVARS[@]}")
169
170     # stage1
171     make -C /build $DRY_RUN "${MAKEVARS[@]}" stage1=true 
172     # store tests_svnpath
173     make -C /build $DRY_RUN "${MAKEVARS[@]}" stage1=true tests_svnpath
174     # versions
175     make -C /build $DRY_RUN "${MAKEVARS[@]}" versions
176     # actual stuff
177     make -C /build $DRY_RUN "${MAKEVARS[@]}" "${MAKETARGETS[@]}"
178
179 }
180
181 # this was formerly run in the myplc-devel chroot but now is run in the root context,
182 # this is so that the .ssh config gets done manually, and once and for all
183 function runtest () {
184     set -x
185     set -e
186     trap failure ERR INT
187
188     echo -n "============================== Starting $COMMAND:runtest on $(date)"
189
190     # where to find TESTS_SVNPATH
191     stamp=/vservers/$BASE/build/tests_svnpath
192     if [ ! -f $stamp ] ; then
193         echo "$COMMAND: Cannot figure TESTS_SVNPATH from missing $stamp"
194         failure
195         exit 1
196     fi
197     TESTS_SVNPATH=$(cat $stamp)
198     # xxx - Thierry - need to rework the test framework in tests/system so it can work
199     # with the entire tests/ module checked out, rather than only tests/system/ 
200     # ugly workaround for now
201     TESTS_SYSTEM_SVNPATH=${TESTS_SVNPATH}/system
202
203     ### the URL to the RPMS/<arch> location
204     url=""
205     for a in i386 x86_64; do
206         archdir=/vservers/$BASE/build/RPMS/$a
207         if [ -d $archdir ] ; then
208             url=$(echo $archdir | sed -e "s,/vservers/$BASE/build,${TESTBUILDURL}${PLDISTRO}/${BASE},")
209             break
210         fi
211     done
212
213     if [ -z "$url" ] ; then
214         echo "$COMMAND: Cannot locate arch URL for testing"
215         failure
216         exit 1
217     fi
218
219     # test directory name on test box
220     testdir=${BASE}
221     # clean it
222     ssh -n ${TESTBOXSSH} rm -rf ${testdir}
223     # check it out 
224     ssh -n ${TESTBOXSSH} svn co ${TESTS_SYSTEM_SVNPATH} ${testdir}
225     # check out the entire tests/ module (with system/ duplicated) as a subdir - see xxx above
226     ssh -n ${TESTBOXSSH} svn co ${TESTS_SVNPATH} ${testdir}/tests
227     # invoke test on testbox - pass url and build url - so the tests can use vtest-init-vserver.sh
228     configs=""
229     for config in ${TESTCONFIG} ; do
230         configs="$configs --config $config"
231     done
232     test_env="-p $PERSONALITY -d $PLDISTRO -f $FCDISTRO"
233
234     # need to proceed despite of set -e
235     success=true
236     ssh 2>&1 -n ${TESTBOXSSH} ${testdir}/runtest --build ${build_SVNPATH} --url ${url} $configs $test_env --all || success=
237
238     # gather logs in the vserver
239     mkdir -p /vservers/$BASE/build/testlogs
240     ssh 2>&1 -n ${TESTBOXSSH} tar -C ${testdir}/logs -cf - . | tar -C /vservers/$BASE/build/testlogs -xf - || true
241     # push them to the build web
242     rsync --archive --delete /vservers/$BASE/build/testlogs/ $WEBPATH/$BASE/testlogs/
243     chmod -R a+r $WEBPATH/$BASE/testlogs/
244
245     if [ -z "$success" ] ; then
246         failure
247     fi
248     
249     echo -n "============================== End $COMMAND:runtest on $(date)"
250 }
251
252 function in_root_context () {
253     rpm -q util-vserver > /dev/null 
254 }
255
256 function sign_node_packages () {
257
258     echo "Signing node packages"
259     
260     need_createrepo=""
261
262     repository=$WEBPATH/$BASE/RPMS/
263     # the rpms that need signing
264     new_rpms=
265     # and the corresponding stamps
266     new_stamps=
267
268     for package in $(find $repository/ -name '*.rpm') ; do
269         stamp=$repository/signed-stamps/$(basename $package).signed
270         # If package is newer than signature stamp
271         if [ $package -nt $stamp ] ; then
272             new_rpms="$new_rpms $package"
273             new_stamps="$new_stamps $stamp"
274         fi
275         # Or than createrepo database
276         [ $package -nt $repository/repodata/repomd.xml ] && need_createrepo=true
277     done
278
279     if [ -n "$new_rpms" ] ; then
280         # Create a stamp once the package gets signed
281         mkdir $repository/signed-stamps 2> /dev/null
282         
283         # Sign RPMS. setsid detaches rpm from the terminal,
284         # allowing the (hopefully blank) GPG password to be
285         # entered from stdin instead of /dev/tty.
286         echo | setsid rpm \
287             --define "_signature gpg" \
288             --define "_gpg_path $GPGPATH" \
289             --define "_gpg_name $GPGUID" \
290             --resign $new_rpms && touch $new_stamps
291     fi
292
293      # Update repository index / yum metadata. 
294     if [ -n "$need_createrepo" ] ; then
295         echo "Indexing node packages after signing"
296         if [ -f $repository/yumgroups.xml ] ; then
297             createrepo --quiet -g yumgroups.xml $repository
298         else
299             createrepo --quiet $repository
300         fi
301     fi
302 }
303
304 function show_env () {
305     set +x
306     echo FCDISTRO=$FCDISTRO
307     echo PLDISTRO=$PLDISTRO
308     echo PERSONALITY=$PERSONALITY
309     echo BASE=$BASE
310     echo build_SVNPATH=$build_SVNPATH
311     echo MAKEVARS="${MAKEVARS[@]}"
312     echo DRY_RUN="$DRY_RUN"
313     echo PLDISTROTAGS="$PLDISTROTAGS"
314     echo TAGSRELEASE="$TAGSRELEASE"
315     # this does not help, it's not yet set when we run show_env
316     #echo WEBPATH="$WEBPATH"
317     echo TESTBUILDURL="$TESTBUILDURL"
318     if in_root_context ; then
319         echo PLDISTROTAGS="$PLDISTROTAGS"
320     else
321         if [ -f /build/$PLDISTROTAGS ] ; then
322             echo "XXXXXXXXXXXXXXXXXXXX Contents of tags definition file /build/$PLDISTROTAGS"
323             cat 
324             echo "XXXXXXXXXXXXXXXXXXXX end tags definition"
325         else
326             echo "XXXXXXXXXXXXXXXXXXXX Cannot find tags definition file /build/$PLDISTROTAGS, assuming remote pldistro"
327         fi
328     fi
329     set -x
330 }
331
332 function usage () {
333     echo "Usage: $COMMAND [option] [var=value...] make-targets"
334     echo "This is $REVISION"
335     echo "Supported options"
336     echo " -f fcdistro - defaults to $DEFAULT_FCDISTRO"
337     echo " -d pldistro - defaults to $DEFAULT_PLDISTRO"
338     echo " -p personality - defaults to $DEFAULT_PERSONALITY"
339     echo " -b base - defaults to $DEFAULT_BASE"
340     echo "    @NAME@ replaced as appropriate"
341     echo " -o base: (overwrite) do not re-create vserver, re-use base instead"
342     echo "    the -f/-d/-t/-s/-p/-m options are uneffective in this case"
343     echo " -t pldistrotags - defaults to \${PLDISTRO}-tags.mk"
344     echo " -r tagsrelease - a release number that refers to PLDISTROTAGS - defaults to HEAD"
345     echo " -s svnpath - where to fetch the build module - defaults to $DEFAULT_build_SVNPATH"
346     echo " -c testconfig - defaults to $DEFAULT_TESTCONFIG"
347     echo " -w webpath - defaults to $DEFAULT_WEBPATH"
348     echo " -W testbuildurl - defaults to $DEFAULT_TESTBUILDURL"
349     echo " -y sign yum repo in webpath"
350     echo " -g path to gpg secring used to sign rpms.  Defaults to $DEFAULT_GPGPATH" 
351     echo " -u gpg email used in secring. Defaults to $DEFAULT_GPGUID"
352     echo " -m mailto - no default"
353     echo " -B : run build only"
354     echo " -T : run test only"
355     echo " -n dry-run : -n passed to make - vserver gets created though - no mail sent"
356     echo " -v : be verbose"
357     echo " -7 : uses weekday-@FCDISTRO@ as base"
358     echo " -i ifname - defaults to $DEFAULT_IFNAME - used to determine local IP"
359     exit 1
360 }
361
362 function main () {
363
364     set -e
365
366     # parse arguments
367     MAKEVARS=()
368     MAKETARGETS=()
369     DRY_RUN=
370     DO_BUILD=true
371     DO_TEST=true
372     SIGNYUMREPO=""
373     while getopts "f:d:p:b:o:t:r:s:x:c:w:W:g:u:m:BTnyv7i:" opt ; do
374         case $opt in
375             f) FCDISTRO=$OPTARG ;;
376             d) PLDISTRO=$OPTARG ;;
377             p) PERSONALITY=$OPTARG ;;
378             b) BASE=$OPTARG ;;
379             o) OVERBASE=$OPTARG ;;
380             t) PLDISTROTAGS=$OPTARG ;;
381             r) TAGSRELEASE=$OPTARG ;;
382             s) build_SVNPATH=$OPTARG ;;
383             c) TESTCONFIG="$TESTCONFIG $OPTARG" ;;
384             w) WEBPATH=$OPTARG ;;
385             W) TESTBUILDURL=$OPTARG ;;
386             y) SIGNYUMREPO=true ;;
387             g) GPGPATH=$OPTARG ;;
388             u) GPGUID=$OPTARG ;;
389             m) MAILTO=$OPTARG ;;
390             B) DO_TEST= ;;
391             T) DO_BUILD= ;;
392             n) DRY_RUN="-n" ;;
393             v) set -x ;;
394             7) BASE="$(date +%a|tr A-Z a-z)-@FCDISTRO@" ;;
395             i) IFNAME=$OPTARG ;;
396             h|*) usage ;;
397         esac
398     done
399         
400     # preserve options for passing them again later, together with expanded base
401     declare -a options
402     toshift=$(($OPTIND - 1))
403     arg=1; while [ $arg -le $toshift ] ; do options=(${options[@]} "$1") ; shift; arg=$(($arg+1)) ; done
404
405     # allow var=value stuff; 
406     for target in "$@" ; do
407         # check if contains '='
408         target1=$(echo $target | sed -e s,=,,)
409         if [ "$target" = "$target1" ] ; then
410             MAKETARGETS=(${MAKETARGETS[@]} "$target")
411         else
412             MAKEVARS=(${MAKEVARS[@]} "$target")
413         fi
414     done
415     
416     # set defaults
417     [ -z "$FCDISTRO" ] && FCDISTRO=$DEFAULT_FCDISTRO
418     [ -z "$PLDISTRO" ] && PLDISTRO=$DEFAULT_PLDISTRO
419     [ -z "$PERSONALITY" ] && PERSONALITY=$DEFAULT_PERSONALITY
420     [ -z "$PLDISTROTAGS" ] && PLDISTROTAGS="${PLDISTRO}-tags.mk"
421     [ -z "$BASE" ] && BASE="$DEFAULT_BASE"
422     [ -z "$WEBPATH" ] && WEBPATH="$DEFAULT_WEBPATH"
423     [ -z "$TESTBUILDURL" ] && TESTBUILDURL="$DEFAULT_TESTBUILDURL"
424     [ -z "$GPGPATH" ] && GPGPATH="$DEFAULT_GPGPATH"
425     [ -z "$GPGUID" ] && GPGUID="$DEFAULT_GPGUID"
426     [ -z "$IFNAME" ] && IFNAME="$DEFAULT_IFNAME"
427     [ -z "$build_SVNPATH" ] && build_SVNPATH="$DEFAULT_build_SVNPATH"
428     [ -z "$TESTCONFIG" ] && TESTCONFIG="$DEFAULT_TESTCONFIG"
429
430     [ -n "$DRY_RUN" ] && MAILTO=""
431         
432     if [ -n "$OVERBASE" ] ; then
433         sedargs="-e s,@DATE@,${DATE},g"
434         BASE=$(echo ${OVERBASE} | sed $sedargs)
435     else
436         sedargs="-e s,@DATE@,${DATE},g -e s,@FCDISTRO@,${FCDISTRO},g -e s,@PLDISTRO@,${PLDISTRO},g -e s,@PERSONALITY@,${PERSONALITY},g"
437         BASE=$(echo ${BASE} | sed $sedargs)
438     fi
439
440     if ! in_root_context ; then
441         # in the vserver
442         echo "==================== Within vserver BEG $(date)"
443         build
444         echo "==================== Within vserver END $(date)"
445
446     else
447         trap failure ERR INT
448         # we run in the root context : 
449         # (*) create or check for the vserver to use
450         # (*) copy this command in the vserver
451         # (*) invoke it
452         
453         if [ -n "$OVERBASE" ] ; then
454             ### Re-use a vserver (finish an unfinished build..)
455             if [ ! -d /vservers/${BASE} ] ; then
456                 echo $COMMAND : cannot find vserver $BASE
457                 exit 1
458             fi
459             # manage LOG - beware it might be a symlink so nuke it first
460             LOG=/vservers/${BASE}.log.txt
461             rm -f $LOG
462             exec > $LOG 2>&1
463             set -x
464             echo "XXXXXXXXXX $COMMAND: using existing vserver $BASE" $(date)
465             # start in case e.g. we just rebooted
466             vserver ${BASE} start || :
467             # update build
468             vserver ${BASE} exec svn update /build
469             # get environment from the first run 
470             FCDISTRO=$(vserver ${BASE} exec /build/getdistroname.sh)
471
472             PLDISTRO=$(vserver ${BASE} exec make --no-print-directory -C /build stage1=skip +PLDISTRO)
473             PLDISTROTAGS=$(vserver ${BASE} exec make --no-print-directory -C /build stage1=skip +PLDISTROTAGS)
474             build_SVNPATH=$(vserver ${BASE} exec make --no-print-directory -C /build stage1=skip +build-SVNPATH)
475             PERSONALITY=$(vserver ${BASE} exec make --no-print-directory -C /build stage1=skip +PERSONALITY)
476             MAILTO=$(vserver ${BASE} exec make --no-print-directory -C /build stage1=skip +MAILTO)
477             show_env
478         else
479             # create vserver: check it does not exist yet
480             i=
481             while [ -d /vservers/${BASE}${i} ] ; do
482                 # we name subsequent builds <base>-n<i> so the logs and builds get sorted properly
483                 [ -z ${i} ] && BASE=${BASE}-n
484                 i=$((${i}+1))
485                 if [ $i -gt 100 ] ; then
486                     echo "$COMMAND: Failed to create build vserver /vservers/${BASE}${i}"
487                     exit 1
488                 fi
489             done
490             BASE=${BASE}${i}
491             # need update
492             # manage LOG - beware it might be a symlink so nuke it first
493             LOG=/vservers/${BASE}.log.txt
494             rm -f $LOG
495             exec > $LOG 2>&1 
496             set -x
497             echo "XXXXXXXXXX $COMMAND: creating vserver $BASE" $(date)
498             show_env
499
500             ### extract the whole build - much simpler
501             tmpdir=/tmp/$COMMAND-$$
502             svn export $build_SVNPATH $tmpdir
503             # Create vserver
504             cd $tmpdir
505             ./vbuild-init-vserver.sh -f ${FCDISTRO} -d ${PLDISTRO} -p ${PERSONALITY} -i ${IFNAME} ${BASE} 
506             # cleanup
507             cd -
508             rm -rf $tmpdir
509             # Extract build again - in the vserver
510             vserver ${BASE} exec svn checkout ${build_SVNPATH} /build
511         fi
512         echo "XXXXXXXXXX $COMMAND: preparation of vserver $BASE done" $(date)
513
514         # The log inside the vserver contains everything
515         LOG2=/vservers/${BASE}/log.txt
516         (echo "==================== BEG VSERVER Transcript of vserver creation" ; \
517          cat $LOG ; \
518          echo "==================== END VSERVER Transcript of vserver creation" ; \
519          echo "xxxxxxxxxx Messing with logs, symlinking $LOG2 to $LOG" ) >> $LOG2
520         ### not too nice : nuke the former log, symlink it to the new one
521         rm $LOG; ln -s $LOG2 $LOG
522         LOG=$LOG2
523         # redirect log again
524         exec >> $LOG 2>&1 
525
526         sedargs="-e s,@DATE@,${DATE},g -e s,@FCDISTRO@,${FCDISTRO},g -e s,@PLDISTRO@,${PLDISTRO},g -e s,@PERSONALITY@,${PERSONALITY},g"
527         WEBPATH=$(echo ${WEBPATH} | sed $sedargs)
528
529         # where to store the log for web access
530         WEBLOG=${WEBPATH}/${BASE}.log.txt
531         # compute the log URL - inserted in the mail messages for convenience
532         LOG_URL=$(echo ${WEBLOG} | sed -e "s,//,/,g" -e "s,/build/,${TESTBUILDURL},")
533         TESTLOGS_URL=$(echo ${WEBPATH}/${BASE}/testlogs | sed -e "s,//,/,g" -e "s,/build/,${TESTBUILDURL},")
534     
535         if [ -n "$DO_BUILD" ] ; then 
536
537             cp $COMMANDPATH /vservers/${BASE}/build/
538
539             # invoke this command in the vserver for building (-T)
540             vserver ${BASE} exec chmod +x /build/$COMMAND
541             vserver ${BASE} exec /build/$COMMAND "${options[@]}" -b "${BASE}" "${MAKEVARS[@]}" "${MAKETARGETS[@]}"
542         fi
543
544         # publish to the web so runtest can find them
545         rm -rf $WEBPATH/$BASE ; mkdir -p $WEBPATH/$BASE/{RPMS,SRPMS}
546         rsync --archive --delete --verbose /vservers/$BASE/build/RPMS/ $WEBPATH/$BASE/RPMS/
547         rsync --archive --delete --verbose /vservers/$BASE/build/SRPMS/ $WEBPATH/$BASE/SRPMS/
548         # publish myplc-release
549         rsync --verbose /vservers/$BASE/build/myplc-release $WEBPATH/$BASE
550
551         # create yum repo and sign packages.
552         if [ -n "$SIGNYUMREPO" ] ; then
553             sign_node_packages
554         fi
555
556         if [ -n "$DO_TEST" ] ; then 
557             runtest
558         fi
559
560         success 
561         
562     fi
563
564 }  
565
566 ##########
567 main "$@"