From: thierry Date: Wed, 25 Mar 2009 15:04:20 +0000 (+0000) Subject: smarter X-Git-Tag: foo~249 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=7b55e0cd45a78d89a63121e9ea79b906366db5a8;p=infrastructure.git smarter --- diff --git a/scripts/all-builds.py b/scripts/all-builds.py index 656045c..585ad00 100755 --- a/scripts/all-builds.py +++ b/scripts/all-builds.py @@ -171,7 +171,11 @@ Examples: # trunk-like builds if not tag: - buildname="%(base)s--%(d)s-%(f)s-%(bit)s"%locals() + if branch == CURRENT_TRUNK: + buildname="%(base)s--%(d)s-%(f)s-%(bit)s"%locals() + else: + buildname="%(base)s--%(branch)s--%(d)s-%(f)s-%(bit)s"%locals() + # tagged builds else: buildname="%(pldistro)s--%(branch)s-%(tag)s-%(f)s-%(bit)s"%locals() diff --git a/scripts/all-builds.sh b/scripts/all-builds.sh deleted file mode 100755 index 0305dac..0000000 --- a/scripts/all-builds.sh +++ /dev/null @@ -1,198 +0,0 @@ -#!/bin/bash -# $Id$ -# this script is managed under subversion at -# http://svn.onelab.eu/infrastructure/scripts/all-builds.sh -# it is triggered every night at 0:05 french time on build.onelab.eu aka blitz.inria.fr - -COMMAND=$(basename $0) - -MAILTO="-m build@onelab.eu" - -echo $COMMAND is deprecated, use all-builds.py instead -exit 1 - - -function usage () { - echo "Usage: $COMMAND [options [ -- vbuild-nightly-options ]]" - echo "In manual mode you should export the following vars (or use related option)" - echo "MAJOR_DISTROS (-d) TRUNK_DISTROS (-td) TRUNK_FCDISTROS (-tf) VS_DISTROS (-vd)" - echo "FCDISTROS (-f) BITS (-i) BASE (-b)" - echo "BUILD_BRANCH(4.2) (-bb) BUILD_TRUNK (-bt)" - echo "Overwrite (-o) TEST (-T) DRY_RUN (-n)" - echo "Use at least one space for blanking a set of distros" - exit 1 -} - -function run () { - [ -n "$manual" ] && echo "$@" '; \' - if [ -z "$DRY_RUN" ] ; then - "$@" - fi -} - -function shortname () { - distro=$1; shift - case $distro in - onelab) echo 1l;; - planetlab) echo pl;; - f?|f1?) echo $distro;; - centos5) echo c5;; - *) echo xx;; - esac -} - -# comment off for usual dailies -#MAJOR=5.0 -#MINOR=rc01 -MAJOR=4.2 -MINOR=rc25 -base_option=-b - -while [[ -n "$@" ]] ; do - case "$1" in - -d) shift ; MAJOR_DISTROS="$MAJOR_DISTROS $1" ;; - -f) shift ; FCDISTROS="$FCDISTROS $1" ;; - -i) shift ; BITS="$BITS $1" ;; - -td) shift; TRUNK_DISTROS="$1" ;; - -tf) shift; TRUNK_FCDISTROS="$1" ;; - -vd) shift; VS_DISTROS="$1" ;; - -b) shift; BASE="$1" ;; - -bb) BUILD_BRANCH=true ;; - -bt) BUILD_TRUNK=true ;; - -o) base_option=-o ;; - -T) TEST=true ;; - -n) DRY_RUN=true ;; - -z) MINOR="" ;; - --) shift; extra_option="$@" ; shift $# ;; - *) usage ;; - esac - shift -done - -FCDISTRO=centos5 -DEFAULT_FCDISTROS="centos5" -DEFAULT_BASE="@DATE@" - -function trunk_builds () { - DEFAULT_BITS="32 64" - DEFAULT_MAJOR_DISTROS="" - DEFAULT_VS_DISTROS="" -# 5.0 ready for planetlab distro only so far - DEFAULT_TRUNK_DISTROS="planetlab" -# DEFAULT_TRUNK_DISTROS="onelab planetlab" - DEFAULT_TRUNK_FCDISTROS="f8 f10" -} - -function branch_builds_42 () { - DEFAULT_MAJOR_DISTROS="onelab planetlab" - DEFAULT_VS_DISTROS="" - DEFAULT_BITS="32" - DEFAULT_TRUNK_DISTROS="" - DEFAULT_TRUNK_FCDISTROS="" - DEFAULT_FCDISTROS="f8" -} - -function tagged_builds_42 () { - DEFAULT_BITS="32 64" - DEFAULT_MAJOR_DISTROS="onelab planetlab" - DEFAULT_VS_DISTROS="onelab" - DEFAULT_TRUNK_DISTROS="" - DEFAULT_TRUNK_FCDISTROS="" -} - -if [ -n "$BUILD_BRANCH" ] ; then - branch_builds_42 - BUILDOPT="-s http://svn.planet-lab.org/svn/build/branches/${MAJOR}" -elif [ -n "$BUILD_TRUNK" ] ; then - trunk_builds - BUILDOPT="" -else - tagged_builds_42 - BUILDOPT="-s http://svn.planet-lab.org/svn/build/tags/${MAJOR}-${MINOR}" -fi - -[[ -n "$@" ]] && usage - -# export any of these to override - this is for manual use only -if [ -z "$MAJOR_DISTROS" ] ; then MAJOR_DISTROS=$DEFAULT_MAJOR_DISTROS ; else manual=true ; fi -if [ -z "$FCDISTROS" ] ; then FCDISTROS=$DEFAULT_FCDISTROS ; else manual=true ; fi -if [ -z "$BITS" ] ; then BITS=$DEFAULT_BITS ; else manual=true ; fi -if [ -z "$TRUNK_DISTROS" ] ; then TRUNK_DISTROS=$DEFAULT_TRUNK_DISTROS ; else manual=true ; fi -if [ -z "$TRUNK_FCDISTROS" ] ; then TRUNK_FCDISTROS=$DEFAULT_TRUNK_FCDISTROS ; else manual=true ; fi -if [ -z "$VS_DISTROS" ] ; then VS_DISTROS=$DEFAULT_VS_DISTROS ; else manual=true ; fi -if [ -z "$BASE" ] ; then BASE=$DEFAULT_BASE ; else manual=true ; fi -[ -n "$TEST" ] && { extra_option="$extra_option -T" ; } -[ -n "$DRY_RUN" ] && { manual=true ; } - -############################## ${MAJOR} -for bits in $BITS; do - for f in $FCDISTROS ; do - for d in $MAJOR_DISTROS ; do - p=linux${bits} - s=$(shortname $d) - if [ -n "$BUILD_BRANCH" ] ; then - buildname="${d}-${MAJOR}-${BASE}-${f}-${bits}" - elif [ -n "$BUILD_TRUNK" ] ; then - buildname="${BASE}--${s}.${MAJOR}--${f}-${bits}" - else - buildname="${d}-${MAJOR}-${MINOR}-${f}-${bits}" - fi - command="/root/bin/vbuild-nightly.sh ${MAILTO} ${BUILDOPT} \ - -d $d -p $p -f $f -t ${d}-tags-${MAJOR}.mk \ - ${base_option} $buildname $extra_option" - run $command - done - done -done - -############################## ${MAJOR}/centos5 -# centos5 : for both archs, make the vserver rpms -# does not test, so skip if test is requested -if [ -z "$TEST" ] ; then - f=centos5 - for d in $VS_DISTROS ; do - for bits in $BITS ; do - p=linux${bits} - s=$(shortname $d) - if [ -n "$BUILD_BRANCH" ] ; then - buildname="${d}-${MAJOR}-${BASE}-vs-${f}-${bits}" - elif [ -n "$BUILD_TRUNK" ] ; then - buildname="${BASE}--${s}.${MAJOR}--vs-${f}-${bits}" - else - buildname="${d}-${MAJOR}-${MINOR}-vs-${f}-${bits}" - fi - command="/root/bin/vbuild-nightly.sh ${MAILTO} ${BUILDOPT} \ - -d $d -p $p -f $f -t ${d}-tags-${MAJOR}.mk \ - ${base_option} $buildname -B $extra_option vserver" - run $command - done - done -fi - -############################## TRUNK -# raw - std planetlab x f8 x 32bits for deploying on alpha nodes -for bits in $BITS; do - - for f in $TRUNK_FCDISTROS; do - fs=$(shortname $f) - p=linux${bits} - d=planetlab - ds=$(shortname $d) - buildname="${BASE}--${ds}-tr${fs}-${bits}" - command="/root/bin/vbuild-nightly.sh ${MAILTO} ${BUILDOPT} \ - -d $d -p $p -f $f ${base_option} $buildname $extra_option" - run $command - done - - for d in $TRUNK_DISTROS; do - ds=$(shortname $d) - p=linux${bits} - f=$FCDISTRO - fs=$(shortname $f) - buildname="${BASE}--${ds}-tr${fs}-${bits}" - command="/root/bin/vbuild-nightly.sh ${MAILTO} ${BUILDOPT} \ - -d $d -p $p -f $f ${base_option} $buildname $extra_option" - run $command - done -done -##############################