3 # feb 2013 - mainline is now known as 5.2, remove that step in the output
4 # meaning results are now in merely
5 # http://build.onelab.eu/modules/version.html
7 # reviewed in dec. 2010
8 # moving back to running on the EU side
10 # this script is a wrapper around the module-tools (version and diff)
11 # it is invoked cyclically
12 # prior to that, the following directories will have been svn updated :
15 # avoid running several instances of this script
16 # when the svn server has problems, this can very well last quite a while
18 COMMAND=$(basename $0)
20 # running as root on liquid
23 LOCK=~/all-modules.run
24 # make sure the cyclic tasks do not interfere with manual usage
25 # (i.e. do not use ~/modules)
26 WORKDIR_GIT=${HOME}/all-modules-git
27 ########## sample config running on liquid
28 #svnpath=http://svn.planet-lab.org/svn/
29 #gitserver=git.onelab.eu
32 #username=not-needed-as-we-dont-write
33 #email=not-needed-as-we-dont-write
36 function do_update() {
38 if [ -f $build_dir/auto-update.sh ] ; then
39 $build_dir/auto-update.sh
40 elif [ -d $build_dir/.git ] ; then
41 ( cd $build_dir; git pull > .update.log 2>&1 )
43 ( cd $build_dir; svn update > .update.log 2>&1 )
47 # usage: do_version dir workdir
48 function do_version () {
53 out_file=$out_dir/version.html
54 out_tmp=$out_dir/.version.html
57 $build_dir/module-version $VERBOSE -w $workdir --www $WWWNAME -a &> $out_tmp
58 mv -f $out_tmp $out_file
61 # usage: do_diff dir workdir
67 out_file=$out_dir/diff.html
68 out_tmp=$out_dir/.diff.html
71 $build_dir/module-diff $VERBOSE -w $workdir --www $WWWNAME -a &> $out_tmp
72 mv -f $out_tmp $out_file
77 echo "Usage: $COMMAND [-v] [-f] [-i]"
82 while [[ -n "$@" ]] ; do
85 -i) ls -l $LOCK ; exit 0 ;;
86 -v) set -x ; VERBOSE=-v ;;
92 # is the stamp older than 2 hours ?
95 is_old=$(find $LOCK -mmin +$GRACE 2> /dev/null)
96 if [ -n "$is_old" ] ; then
97 echo "$LOCK is older than $GRACE minutes - removing"
101 [ -f $LOCK ] && exit 1
105 do_update ~/git-build
106 do_version ~/git-build $WORKDIR_GIT
107 do_diff ~/git-build $WORKDIR_GIT
115 ########################################
116 # this applied to the older version that was running at princeton
118 # as the svn diff operations from a remote location are so sssssslllllllooooooooowwwwww...
120 # maintain codebase in onelab.eu for historical reasons
121 # (1) push scripts on princeton (manually run all-modules-update.sh)
122 # (2) run the scripts cyclically over there through cron
123 # and push the results on build.onelab.eu with all-modules.push.sh (as part of the cron job)