Commit af5361a153b36a5774925cc7d6e4d5da9a575bfa
1 parent
0068a248
added release script
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2426 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
71 additions
and
0 deletions
bin/releaseKT.sh
0 → 100755
| 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` -b branch -v version -v version" | ||
| 12 | + echo " eg. `basename $0` -b BRANCH_1_0_1_20030728 -v 1.1.2" | ||
| 13 | + exit 1 | ||
| 14 | +} | ||
| 15 | + | ||
| 16 | +deploy() { | ||
| 17 | + # cleanup | ||
| 18 | + rm -rf $tmp 2> /dev/null | ||
| 19 | + mkdir $tmp | ||
| 20 | + | ||
| 21 | + # export kt | ||
| 22 | + cd $tmp | ||
| 23 | + cvs -d $cvsroot export -r $branch knowledgeTree | ||
| 24 | + | ||
| 25 | + # tar it up | ||
| 26 | + rm /tmp/knowledgeTree-$version.tgz 2> /dev/null | ||
| 27 | + tar -czvf /tmp/knowledgeTree-$version.tgz knowledgeTree | ||
| 28 | + | ||
| 29 | + # convert src to windoze line-endings | ||
| 30 | + find $tmp/knowledgeTree -name \*\.php -exec unix2dos {} \; 2> /dev/null | ||
| 31 | + find $tmp/knowledgeTree -name \*\.inc -exec unix2dos {} \; 2> /dev/null | ||
| 32 | + find $tmp/knowledgeTree -name \*\.txt -exec unix2dos {} \; 2> /dev/null | ||
| 33 | + | ||
| 34 | + # zip it up | ||
| 35 | + rm /tmp/knowledgeTree-$version.zip 2> /dev/null | ||
| 36 | + zip -r /tmp/knowledgeTree-$version.zip knowledgeTree | ||
| 37 | + | ||
| 38 | + # move them to this dir | ||
| 39 | + cd - | ||
| 40 | + mv /tmp/knowledgeTree-$version.* . | ||
| 41 | + | ||
| 42 | + # clean up | ||
| 43 | + rm -rf $tmp 2> /dev/null | ||
| 44 | +} | ||
| 45 | + | ||
| 46 | +# check the command line options | ||
| 47 | +if [ $# -lt 2 ]; then | ||
| 48 | + usage | ||
| 49 | +fi | ||
| 50 | + | ||
| 51 | +# process the params | ||
| 52 | +while getopts ":b:v:" Option | ||
| 53 | +do | ||
| 54 | + case $Option in | ||
| 55 | + b ) branch=$OPTARG;; | ||
| 56 | + v ) version=$OPTARG;; | ||
| 57 | + * ) usage;; | ||
| 58 | + esac | ||
| 59 | +done | ||
| 60 | + | ||
| 61 | +# check that everything we want is set | ||
| 62 | +if [ -z $branch -o -z $version ]; then | ||
| 63 | + usage | ||
| 64 | +fi | ||
| 65 | + | ||
| 66 | +# setup up some paths and stuff | ||
| 67 | +cvsroot=/usr/local/cvsroot | ||
| 68 | +tmp=/tmp/dms | ||
| 69 | + | ||
| 70 | +# now just do it | ||
| 71 | +deploy |