X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=tools%2Fsfsnapshot;h=efc5f0137af3f8001695d948b97aa76dc1af5ffb;hb=bd2cc1811bdea7fe77acab43e281dd3915882b24;hp=47421af4668b30f29df1b1402759a8fbe6e27724;hpb=ee3a73bc338f3b763b5797bc90ca0c026d6504ce;p=nagiosplug.git diff --git a/tools/sfsnapshot b/tools/sfsnapshot index 47421af..efc5f01 100755 --- a/tools/sfsnapshot +++ b/tools/sfsnapshot @@ -2,55 +2,111 @@ # Butchered version of snapshot # Can only run on the shell compile farm server +# Will always create a snapshot of HEAD +# If want multiple snapshots, just run with "sfsnapshot [branch ...]" # Assumes: # ssh setup to send to shell.sf.net and $CF without password prompt -# autconf and automake installed on shell cf at v 2.57 & 1.72 and in PATH +# the compile server has all the prerequisites stated at http://nagiosplug.sourceforge.net/developer-guidelines.html +# Install in cron with something like: +# 47 * * * * $HOME/bin/mail_error -o $HOME/sfsnapshot.out -m tonvoon@users.sf.net sfsnapshot r1_3_0 function die { echo $1; exit 1; } +# This makes the distribution. Expects $1 as branches/name, otherwise uses trunk +function make_dist { + if [[ -n $1 ]] ; then + svn_url_suffix=$1 + name=${1##*/} + else + svn_url_suffix="trunk" + name="trunk" + fi + v="$name-" + + # Get compile server to do the work + # Variables will be expanded locally before being run on $CF + ssh $CF </dev/null) +[[ -z $files ]] && die "No files created" +head_file=$(cd $IN && ls *-trunk-*.gz 2>/dev/null) +ssh -2 $OUT_SERVER "rm -f $OUT/*.gz" +scp -2 $files $OUT_SERVER:$OUT +if [[ -n $head_file ]] ; then + ssh -2 $OUT_SERVER "cd $OUT && ln -s $head_file nagios-plugins-HEAD.tar.gz" fi -sed 's/^VER=.*/VER=${DS}/;s/^REL=.*/REL=snapshot/' configure.in > configure.tmp -mv configure.tmp configure.in -aclocal -autoheader -autoconf -automake -autoreconf +# Create MD5 sum +ssh -2 $OUT_SERVER << EOF +cd $OUT +cat <<-END_README > README +This is the daily SVN snapshot of nagiosplug, consisting of the SVN trunk +and any other branches. -# Make the Nagiosplug dist tarball -./configure -make dist +The nagios-plugins-HEAD.tar.gz link will always go to the latest trunk snapshot +(name kept for existing tinderbox scripts to link correctly). -# End ssh +The MD5SUM is: +END_README +md5sum *.gz | tee -a README > MD5SUM EOF -# Check for *.gz files locally (expect NFS between cf shell server and $CF) -set -x -cd $IN/$PROJECT -ls *.gz > /dev/null 2>&1 || die "No file created" -ssh $OUT_SERVER "rm -f $OUT/*.gz" -scp *.gz $OUT_SERVER:$OUT -rm -f *.gz +rm -f $files +# Work out success or failure +expected=$(($# + 1)) +set -- $files +[[ $# -ne $expected ]] && die "Expected $expected, got $#" +exit 0