source: main/trunk/release-kits/bin/rk@ 21386

Last change on this file since 21386 was 21386, checked in by oranfry, 14 years ago

rearranging into one release kit

  • Property svn:executable set to *
File size: 1.8 KB
RevLine 
[18904]1#!/bin/bash
[21362]2
[18904]3function show_title() {
[21386]4 echo "RK_HOME: $RK_HOME"
[19006]5 echo "O---------------------------------------------O"
6 echo
7 echo " $rk_name ";
8 echo " $rk_fullname ";
9 echo
10 echo "O---------------------------------------------O"
11
[18904]12}
13
[16540]14function show_help {
15 echo "$rk_name - $rk_fullname"
[21386]16 echo "Automatically creates Greenstone releases"
[16540]17 echo
[21386]18 echo "usage: $rk_name [-help|-cmd] [ANT_ARGS]"
[17042]19 echo " -help"
20 echo " show this help screen"
21 echo
[18904]22 echo " -cmd"
23 echo " show the ant command being used by $rk_name"
[19037]24 echo
[21386]25 echo " ANT_ARGS"
26 echo " Additional arguments to be passed to ant"
[16540]27}
28
[21386]29#determine requested release kit
30rk_name="$(basename $0)"
31export RK_HOME="$(cd "$(dirname "$0")/.." && pwd)"
32
33if [ "$rk_name" == "rk2" ]; then
34 rk_fullname="Release Kit for Greenstone2"
35elif [ "$rk_name" == "rk3" ]; then
36 rk_fullname="Release Kit for Greenstone3"
37else
38 echo "Unrecognised release-kit name '$rk_name'" >&2
39 exit
40fi
41
42
[17633]43#cd up a level or two if needed
[21386]44if [ -e "$rk_name-build.properties" ]; then
45 pushd .
46elif [ -e "../$rk_name-build.properties" ]; then
47 pushd ..
48elif [ -e "../../$rk_name-build.properties" ]; then
49 pushd ../..
50else
51 echo "couldn't find file $rk_name-build.properties"
52 echo "it should exist in the top level of the release"
53 exit
[17633]54fi
55
[21386]56#make sure ant has enough memory
[17401]57export ANT_OPTS=-Xmx800M
[16732]58
[16540]59#create the command
[21386]60toexec="ant -lib `pwd`/installer/classes -f $RK_HOME/$rk_name/ant-scripts/build.xml -Dbasedir=`pwd` -D$rk_name.home=$RK_HOME"
[16540]61
62#pass on the arguments
63while [ "$1" != "" ]; do
64
65 if [ "$1" == "-help" ]; then
66 show_help
67 exit
[18904]68 elif [ "$1" == "-cmd" ]; then
69 show_cmd=true
[16540]70 else
71 toexec="$toexec $1"
72 fi
[16802]73 shift
[16540]74
75done
[16802]76
[21386]77#show the command to be executed
[18904]78if [ "$show_cmd" == "true" ]; then
79 echo $toexec
[21386]80#execute
[18904]81else
82 show_title | tee ${rk_name}.out
83 $toexec 2>&1 | tee -a ${rk_name}.out
84fi
85
[21386]86#go back to original dir
87popd
Note: See TracBrowser for help on using the repository browser.