diff options
-rwxr-xr-x | tools/sfsnapshot | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/tools/sfsnapshot b/tools/sfsnapshot index 122fb717..a383760e 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 |
44 | EOF | 50 | EOF |
45 | } | 51 | } |
46 | 52 | ||
47 | # Set working variables | 53 | # Set working variables |
48 | PROJECT=nagiosplug | 54 | PROJECT=nagiosplug |
55 | |||
56 | # This is local to the compile server for faster compile | ||
57 | COMPILE_DIR=/tmp/tonvoon/tmp_snapshot | ||
58 | |||
59 | # Needs to be on NFS so gz file can be read on the compile shell server | ||
49 | IN=${HOME}/tmp_snapshot | 60 | IN=${HOME}/tmp_snapshot |
61 | |||
62 | # Where to place the generated files | ||
50 | OUT_SERVER="shell.sf.net" | 63 | OUT_SERVER="shell.sf.net" |
51 | OUT="/home/groups/n/na/nagiosplug/htdocs/snapshot" | 64 | OUT="/home/groups/n/na/nagiosplug/htdocs/snapshot" |
52 | CF="usf-cf-x86-linux-2" | 65 | |
53 | CF="usf-cf-x86-linux-1" | 66 | # Make sure prereqs are satisfied on server! |
54 | CF="x86-linux2" | 67 | CF="x86-solaris1" |
55 | CF="x86-linux1" | ||
56 | DS=`date -u +%Y%m%d%H%M` | 68 | DS=`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 |
59 | make_dist | 74 | make_dist |
60 | for i in $* ; do | 75 | for 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) |
65 | set -x | 80 | set -x |
66 | files=$(ls $IN/*/$PROJECT/*.gz 2>/dev/null) | 81 | files=$(ls $IN/*.gz 2>/dev/null) |
67 | [[ -z $files ]] && die "No files created" | 82 | [[ -z $files ]] && die "No files created" |
68 | ssh $OUT_SERVER "rm -f $OUT/*.gz" | 83 | ssh $OUT_SERVER "rm -f $OUT/*.gz" |
69 | scp $files $OUT_SERVER:$OUT | 84 | scp $files $OUT_SERVER:$OUT |