sfsnapshot 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #! /bin/bash
  2. # Butchered version of snapshot
  3. # Can only run on the shell compile farm server
  4. # Assumes:
  5. # ssh setup to send to shell.sf.net and $CF without password prompt
  6. # autconf and automake installed on shell cf at v 2.57 & 1.72 and in PATH
  7. function die { echo $1; exit 1; }
  8. # Set working variables
  9. PROJECT=nagiosplug
  10. IN=${HOME}/tmp_snapshot
  11. OUT_SERVER="shell.sf.net"
  12. OUT="/home/groups/n/na/nagiosplug/htdocs/snapshot"
  13. CF="usf-cf-x86-linux-2"
  14. DS=`date -u +%Y%m%d%H%M`
  15. # Get compile server to do the work
  16. # Variables will be expanded locally before being run on $CF
  17. ssh $CF <<EOF
  18. PATH=$PATH
  19. [[ ! -d $IN ]] && mkdir -p $IN
  20. cd ${IN}
  21. if [[ -d $PROJECT ]] ; then
  22. cd $PROJECT
  23. rm -f configure.in
  24. cvs update
  25. else
  26. cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/nagiosplug co nagiosplug
  27. cd $PROJECT
  28. fi
  29. sed 's/^VER=.*/VER=${DS}/;s/^REL=.*/REL=snapshot/' configure.in > configure.tmp
  30. mv configure.tmp configure.in
  31. aclocal
  32. autoheader
  33. autoconf
  34. automake
  35. autoreconf
  36. # Make the Nagiosplug dist tarball
  37. ./configure
  38. make dist
  39. # End ssh
  40. EOF
  41. # Check for *.gz files locally (expect NFS between cf shell server and $CF)
  42. set -x
  43. cd $IN/$PROJECT
  44. ls *.gz > /dev/null 2>&1 || die "No file created"
  45. ssh $OUT_SERVER "rm -f $OUT/*.gz"
  46. scp *.gz $OUT_SERVER:$OUT
  47. rm -f *.gz