X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=tools%2Fsfsnapshot;h=efc5f0137af3f8001695d948b97aa76dc1af5ffb;hb=bd2cc1811bdea7fe77acab43e281dd3915882b24;hp=8e82f298254377ef38d5905de592c109b6fa45dc;hpb=38ffa48b64165325a2eb4a625cbb05e1dfb0d348;p=nagiosplug.git diff --git a/tools/sfsnapshot b/tools/sfsnapshot index 8e82f29..efc5f01 100755 --- a/tools/sfsnapshot +++ b/tools/sfsnapshot @@ -3,63 +3,74 @@ # 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} [branch2 ...]" +# 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 CVS tag, otherwise uses HEAD +# This makes the distribution. Expects $1 as branches/name, otherwise uses trunk function make_dist { if [[ -n $1 ]] ; then - cvs_rel=$1 - v="$1-" + svn_url_suffix=$1 + name=${1##*/} else - cvs_rel="HEAD" - v="" + 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 <<-EOF + ssh $CF < configure.tmp - mv configure.tmp configure.in - aclocal -I lib - autoheader - autoconf - automake --add-missing --copy - autoreconf ./configure # Make the Nagiosplug dist tarball - make dist + make dist VERSION=$v$DS RELEASE=snapshot + + # May fail if file not generated - do not trap + mv *.gz $IN + rm -rf $COMPILE_DIR # End ssh - EOF +EOF } # Set working variables PROJECT=nagiosplug + +# This is local to the compile server for faster compile +COMPILE_DIR=/tmp/tonvoon/tmp_snapshot + +# Needs to be on NFS so gz file can be read on the compile shell server IN=${HOME}/tmp_snapshot -OUT_SERVER="shell.sf.net" + +# Where to place the generated files +OUT_SERVER="tonvoon@shell.sf.net" OUT="/home/groups/n/na/nagiosplug/htdocs/snapshot" -CF="usf-cf-x86-linux-2" + +# Make sure prereqs are satisfied on server! +CF="localhost" DS=`date -u +%Y%m%d%H%M` +# Setup home directory area +[[ ! -d $IN ]] && mkdir -p $IN + # Make dists for HEAD and any others in command parameters make_dist for i in $* ; do @@ -68,15 +79,28 @@ done # Check for *.gz files locally (expect NFS between cf shell server and $CF) set -x -files=$(ls $IN/*/$PROJECT/*.gz 2>/dev/null) +files=$(ls $IN/*.gz 2>/dev/null) [[ -z $files ]] && die "No files created" -ssh $OUT_SERVER "rm -f $OUT/*.gz" -scp $files $OUT_SERVER:$OUT +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 # Create MD5 sum -ssh $OUT_SERVER << EOF +ssh -2 $OUT_SERVER << EOF cd $OUT -md5sum *.gz > MD5SUM +cat <<-END_README > README +This is the daily SVN snapshot of nagiosplug, consisting of the SVN trunk +and any other branches. + +The nagios-plugins-HEAD.tar.gz link will always go to the latest trunk snapshot +(name kept for existing tinderbox scripts to link correctly). + +The MD5SUM is: +END_README +md5sum *.gz | tee -a README > MD5SUM EOF rm -f $files