simple
[infrastructure.git] / scripts / all-builds.sh
1 #!/bin/bash
2 # this script is managed under subversion at 
3 # http://svn.one-lab.org/infrastructure/scripts/all-builds.sh
4 # it is triggered every night at 0:05 french time on build.one-lab.org aka blitz.inria.fr
5
6 COMMAND=$(basename $0)
7
8 function usage () {
9     echo "Usage: $COMMAND"
10     echo "In manual mode you should export either of these"
11     echo "PLDISTROS FCDISTROS BITS RETRY TEST DRY_RUN"
12     exit 1
13 }
14
15 [[ -n "$@" ]] && usage
16
17 # tuned for allowing manual re-runs, mostly for tests
18
19 DEFAULT_PLDISTROS="planetlab onelab"
20 DEFAULT_FCDISTROS="f8"
21 DEFAULT_BITS="32 64"
22
23 # export any of these to override - this is for manual use only
24 if [ -z "$PLDISTROS" ] ; then PLDISTROS=$DEFAULT_PLDISTROS ; else manual=true ; fi
25 if [ -z "$FCDISTROS" ] ; then FCDISTROS=$DEFAULT_FCDISTROS ; else manual=true ; fi
26 if [ -z "$BITS" ] ;      then BITS=$DEFAULT_BITS ;           else manual=true ; fi
27 [ -n "$RETRY" ] &&      { extra_option="$extra_option -o" ; manual=true ; }
28 [ -n "$TEST" ] &&       { extra_option="$extra_option -T" ; manual=true ; }
29 [ -n "$DRY_RUN" ] &&    { manual=true ; }
30
31 function run () {
32     [ -n "$manual" ] && echo "$@"
33     if [ -n "$DRY_RUN" ] ; then
34         echo "dry-run: skipped"
35     else
36         "$@"
37     fi
38 }
39
40 for d in $PLDISTROS ; do
41     for f in $FCDISTROS ; do 
42         for bits in $BITS; do
43             p=linux${bits}
44             command="/root/bin/vbuild-nightly.sh -m onelab-build@one-lab.org \
45                 -f $f -p $p -d $d \
46                 -t ${d}-tags-4.2.mk \
47                 -b @DATE@--${d}.4.2--${f}-${bits} $extra_option"
48             run $command
49         done
50     done
51 done
52
53 [ -n "$manual" ] && { echo 'manual mode : bailing out' ; exit 0 ; }
54
55 # raw - std planetlab x f8 x 32bits for deploying on alpha nodes
56 for bits in 32 64; do
57     p=linux${bits}
58     command="/root/bin/vbuild-nightly.sh -m onelab-build@one-lab.org -p $p -b @DATE@--trunk${bits}"
59     run $command
60 done
61
62 # the following gets skipped in any manual mode 
63 # centos5 : for both archs, make the vserver rpms
64 for d in onelab ; do
65     for bits in 32 64; do
66         p=linux${bits}
67         command="/root/bin/vbuild-nightly.sh -m onelab-build@one-lab.org \
68             -f centos5 -p $p -d $d \
69             -b @DATE@--trunk-c5vs-${bits} \
70             -B vserver"
71         run $command
72     done
73 done