summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorTon Voon <tonvoon@users.sourceforge.net>2003-03-08 00:55:50 +0000
committerTon Voon <tonvoon@users.sourceforge.net>2003-03-08 00:55:50 +0000
commit7e4aefaa0b128815cb0d92796ba7091b7aa5ccc1 (patch)
tree91833c44545fb7c152d374226176cf043633de5b /tools
parent0d7347fc41b4a0d1948cec5646135da7c2e5c13a (diff)
downloadmonitoring-plugins-7e4aefaa0b128815cb0d92796ba7091b7aa5ccc1.tar.gz
Adds MD5SUM file, creates multiple branch snapshots and doesn't
rerun configure/automake/autoconf unnecessarily git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@378 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'tools')
-rwxr-xr-xtools/sfsnapshot92
1 files changed, 58 insertions, 34 deletions
diff --git a/tools/sfsnapshot b/tools/sfsnapshot
index 47421af4..5cbdfb43 100755
--- a/tools/sfsnapshot
+++ b/tools/sfsnapshot
@@ -2,55 +2,79 @@
2 2
3# Butchered version of snapshot 3# Butchered version of snapshot
4# Can only run on the shell compile farm server 4# Can only run on the shell compile farm server
5# Will always create a snapshot of HEAD
6# If want multiple snapshots, just run with "sfsnapshot {branch} [branch2 ...]"
5# Assumes: 7# Assumes:
6# ssh setup to send to shell.sf.net and $CF without password prompt 8# ssh setup to send to shell.sf.net and $CF without password prompt
7# autconf and automake installed on shell cf at v 2.57 & 1.72 and in PATH 9# autconf and automake installed on shell cf at v 2.57 & 1.72 and in PATH
8 10
9function die { echo $1; exit 1; } 11function die { echo $1; exit 1; }
10 12
13# This makes the distribution. Expects $1 as CVS tag, otherwise uses HEAD
14function make_dist {
15 if [[ -n $1 ]] ; then
16 cvs_rel=$1
17 v="$1-"
18 else
19 cvs_rel="HEAD"
20 v=""
21 fi
22
23 # Get compile server to do the work
24 # Variables will be expanded locally before being run on $CF
25 ssh $CF <<-EOF
26 set -x
27 PATH=$PATH
28 [[ ! -d $IN/$cvs_rel ]] && mkdir -p $IN/$cvs_rel
29 cd $IN/$cvs_rel
30 if [[ -d $PROJECT ]] ; then
31 cd $PROJECT
32 cvs update -r $cvs_rel
33 else
34 cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/nagiosplug co -r $cvs_rel nagiosplug
35 cd $PROJECT
36 aclocal
37 autoheader
38 autoconf
39 automake
40 autoreconf
41 ./configure
42 fi
43
44 # Make the Nagiosplug dist tarball
45 VER=$v$DS VERSION=$v$DS REL=snapshot make -e dist
46
47 # End ssh
48 EOF
49}
50
11# Set working variables 51# Set working variables
12PROJECT=nagiosplug 52PROJECT=nagiosplug
13IN=${HOME}/tmp_snapshot 53IN=${HOME}/tmp_snapshot
14OUT_SERVER="shell.sf.net" 54OUT_SERVER="shell.sf.net"
15OUT="/home/groups/n/na/nagiosplug/htdocs/snapshot" 55#OUT="/home/groups/n/na/nagiosplug/htdocs/snapshot"
56OUT="~/test"
16CF="usf-cf-x86-linux-2" 57CF="usf-cf-x86-linux-2"
17DS=`date -u +%Y%m%d%H%M` 58DS=`date -u +%Y%m%d%H%M`
18 59
19# Get compile server to do the work 60# Make dists for HEAD and any others in command parameters
20# Variables will be expanded locally before being run on $CF 61make_dist
21ssh $CF <<EOF 62for i in $* ; do
22PATH=$PATH 63 make_dist $i
23[[ ! -d $IN ]] && mkdir -p $IN 64done
24cd ${IN}
25if [[ -d $PROJECT ]] ; then
26 cd $PROJECT
27 rm -f configure.in
28 cvs update
29else
30 cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/nagiosplug co nagiosplug
31 cd $PROJECT
32fi
33
34sed 's/^VER=.*/VER=${DS}/;s/^REL=.*/REL=snapshot/' configure.in > configure.tmp
35mv configure.tmp configure.in
36aclocal
37autoheader
38autoconf
39automake
40autoreconf
41
42# Make the Nagiosplug dist tarball
43./configure
44make dist
45
46# End ssh
47EOF
48 65
49# Check for *.gz files locally (expect NFS between cf shell server and $CF) 66# Check for *.gz files locally (expect NFS between cf shell server and $CF)
50set -x 67set -x
51cd $IN/$PROJECT 68files=$(ls $IN/*/$PROJECT/*.gz 2>/dev/null)
52ls *.gz > /dev/null 2>&1 || die "No file created" 69[[ -z $files ]] && die "No files created"
53ssh $OUT_SERVER "rm -f $OUT/*.gz" 70ssh $OUT_SERVER "rm -f $OUT/*.gz"
54scp *.gz $OUT_SERVER:$OUT 71scp $files $OUT_SERVER:$OUT
55rm -f *.gz 72
73# Create MD5 sum
74ssh $OUT_SERVER << EOF
75cd $OUT
76md5sum *.gz > MD5SUM
77EOF
78
79rm -f $files
56 80