summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/sfsnapshot39
1 files changed, 27 insertions, 12 deletions
diff --git a/tools/sfsnapshot b/tools/sfsnapshot
index 122fb71..a383760 100755
--- a/tools/sfsnapshot
+++ b/tools/sfsnapshot
@@ -3,10 +3,10 @@
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 5# Will always create a snapshot of HEAD
6# If want multiple snapshots, just run with "sfsnapshot {branch} [branch2 ...]" 6# If want multiple snapshots, just run with "sfsnapshot [branch ...]"
7# Assumes: 7# Assumes:
8# 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
9# autconf and automake installed on shell cf at v 2.57 & 1.72 and in PATH 9# the compile server has all the prerequisites stated at http://nagiosplug.sourceforge.net/developer-guidelines.html
10# Install in cron with something like: 10# Install in cron with something like:
11# 47 * * * * $HOME/bin/mail_error -o $HOME/sfsnapshot.out -m tonvoon@users.sf.net sfsnapshot r1_3_0 11# 47 * * * * $HOME/bin/mail_error -o $HOME/sfsnapshot.out -m tonvoon@users.sf.net sfsnapshot r1_3_0
12 12
@@ -27,34 +27,49 @@ function make_dist {
27 ssh $CF <<EOF 27 ssh $CF <<EOF
28 set -x 28 set -x
29 PATH=$PATH 29 PATH=$PATH
30 [[ ! -d $IN/$cvs_rel ]] && mkdir -p $IN/$cvs_rel 30 [[ ! -d $COMPILE_DIR/$cvs_rel ]] && mkdir -p $COMPILE_DIR/$cvs_rel
31 cd $IN/$cvs_rel 31 cd $COMPILE_DIR/$cvs_rel
32 #rm -f $PROJECT/configure.in 32
33 # Cannot use cvs export due to conflicts on second run - think this is better for cvs server
33 cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/nagiosplug co -r $cvs_rel nagiosplug 34 cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/nagiosplug co -r $cvs_rel nagiosplug
35
34 cd $PROJECT 36 cd $PROJECT
35 #sed 's/^VER=.*/VER=$v$DS/;s/^REL=.*/REL=snapshot/' configure.in > configure.tmp 37
36 #mv configure.tmp configure.in 38 # TODO: Maybe this should only be run when necessary?
37 tools/setup 39 tools/setup
40
38 ./configure 41 ./configure
39 42
40 # Make the Nagiosplug dist tarball 43 # Make the Nagiosplug dist tarball
41 make dist VERSION=$v$DS RELEASE=snapshot 44 make dist VERSION=$v$DS RELEASE=snapshot
42 45
46 # May fail if file not generated - do not trap
47 mv *.gz $IN
48
43 # End ssh 49 # End ssh
44EOF 50EOF
45} 51}
46 52
47# Set working variables 53# Set working variables
48PROJECT=nagiosplug 54PROJECT=nagiosplug
55
56# This is local to the compile server for faster compile
57COMPILE_DIR=/tmp/tonvoon/tmp_snapshot
58
59# Needs to be on NFS so gz file can be read on the compile shell server
49IN=${HOME}/tmp_snapshot 60IN=${HOME}/tmp_snapshot
61
62# Where to place the generated files
50OUT_SERVER="shell.sf.net" 63OUT_SERVER="shell.sf.net"
51OUT="/home/groups/n/na/nagiosplug/htdocs/snapshot" 64OUT="/home/groups/n/na/nagiosplug/htdocs/snapshot"
52CF="usf-cf-x86-linux-2" 65
53CF="usf-cf-x86-linux-1" 66# Make sure prereqs are satisfied on server!
54CF="x86-linux2" 67CF="x86-solaris1"
55CF="x86-linux1"
56DS=`date -u +%Y%m%d%H%M` 68DS=`date -u +%Y%m%d%H%M`
57 69
70# Setup home directory area
71[[ ! -d $IN ]] && mkdir -p $IN
72
58# Make dists for HEAD and any others in command parameters 73# Make dists for HEAD and any others in command parameters
59make_dist 74make_dist
60for i in $* ; do 75for i in $* ; do
@@ -63,7 +78,7 @@ done
63 78
64# Check for *.gz files locally (expect NFS between cf shell server and $CF) 79# Check for *.gz files locally (expect NFS between cf shell server and $CF)
65set -x 80set -x
66files=$(ls $IN/*/$PROJECT/*.gz 2>/dev/null) 81files=$(ls $IN/*.gz 2>/dev/null)
67[[ -z $files ]] && die "No files created" 82[[ -z $files ]] && die "No files created"
68ssh $OUT_SERVER "rm -f $OUT/*.gz" 83ssh $OUT_SERVER "rm -f $OUT/*.gz"
69scp $files $OUT_SERVER:$OUT 84scp $files $OUT_SERVER:$OUT