Commit eae1096c063d536c55161ad0cfa71b87c6a988c9
1 parent
73ef4435
Remove old unused script
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3568 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
0 additions
and
76 deletions
bin/remote_update.sh deleted
| 1 | -#!/bin/sh | |
| 2 | -# | |
| 3 | -# script to checkout the latest tagged build from cvs and upload | |
| 4 | -# to the remote server of your choice | |
| 5 | - | |
| 6 | -## functions | |
| 7 | - | |
| 8 | -# displays the script usage message | |
| 9 | -# | |
| 10 | -usage() { | |
| 11 | - echo "usage: `basename $0` -t cvstag -h user@host -d remoteDir" | |
| 12 | - echo " eg. `basename $0` -t DMS_ITERATION1_29012003 -h michael@gobbler.jamwarehouse.com -d /usr/local/www/owl/dms" | |
| 13 | - exit 1 | |
| 14 | -} | |
| 15 | - | |
| 16 | -deploy() { | |
| 17 | - # cleanup | |
| 18 | - rm -rf $tmp 2> /dev/null | |
| 19 | - mkdir $tmp | |
| 20 | - | |
| 21 | - # export owl | |
| 22 | - cd $tmp | |
| 23 | - cvs -d $cvsroot co -r $tag owl | |
| 24 | - cd owl/Documents | |
| 25 | - cvs update -d | |
| 26 | - | |
| 27 | - # remove CVS directories | |
| 28 | - find $tmp -name CVS -exec rm -rf {} \; 2> /dev/null | |
| 29 | - | |
| 30 | - # tar it up | |
| 31 | - rm /tmp/owl.tgz 2> /dev/null | |
| 32 | - tar -czvf /tmp/owl.tgz $tmp | |
| 33 | - | |
| 34 | - # clean up | |
| 35 | - rm -rf $tmp 2> /dev/null | |
| 36 | - | |
| 37 | - # punt it over the wall | |
| 38 | - scp /tmp/owl.tgz $host:/tmp/ | |
| 39 | - | |
| 40 | - # untar it remotely | |
| 41 | - ssh $host "cd $remotePath; mv $remoteDir $remoteDir-`date +%Y-%m-%d`; tar -zxvf /tmp/owl.tgz; rm /tmp/owl.tgz; mv tmp/dms/owl $remoteDir; rm -rf tmp" | |
| 42 | -} | |
| 43 | - | |
| 44 | -# check the command line options | |
| 45 | -if [ $# -lt 3 ]; then | |
| 46 | - usage | |
| 47 | -fi | |
| 48 | - | |
| 49 | -# process the params | |
| 50 | -while getopts ":t:h:d:" Option | |
| 51 | -do | |
| 52 | - case $Option in | |
| 53 | - t ) tag=$OPTARG;; | |
| 54 | - h ) host=$OPTARG;; | |
| 55 | - d ) dir=$OPTARG ;; | |
| 56 | - * ) usage;; | |
| 57 | - esac | |
| 58 | -done | |
| 59 | - | |
| 60 | -# check that everything we want is set | |
| 61 | -if [ -z $tag -o -z $host -o -z $dir ]; then | |
| 62 | - usage | |
| 63 | -fi | |
| 64 | - | |
| 65 | -# setup up some paths and stuff | |
| 66 | -cvsroot=/usr/local/cvsroot | |
| 67 | -tmp=/tmp/dms | |
| 68 | -remotePath=`dirname $dir` | |
| 69 | -remoteDir=`basename $dir` | |
| 70 | - | |
| 71 | -# now just do it | |
| 72 | -# TODO: return code handling | |
| 73 | -deploy | |
| 74 | - | |
| 75 | -# reminder | |
| 76 | -echo "don't forget to run fix_perms.sh on the remote machine as root to allow the www user access to the dms" |