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

Last change on this file since 35484 was 34256, checked in by ak19, 4 years ago

Tried to add the infrastructure for standalone client-gli (client-fli) to release kit, but there's no way of testing it from home as many properties are simply not set with a plain release-kit checkout and libraries for using things like <if> are also unavailable despite importing shared.xml

  • Property svn:executable set to *
File size: 2.3 KB
Line 
1#!/bin/bash
2
3function show_title() {
4 echo "RK_HOME: $RK_HOME"
5 echo "O---------------------------------------------O"
6 echo
7 echo " $rk_name ";
8 echo " $rk_fullname ";
9 echo
10 echo "O---------------------------------------------O"
11
12}
13
14function show_help {
15 echo "usage: {rk2|rk3|sork2|sork2|cdrk2|derk|clientrk} [-help|-cmd] [ANT_ARGS]"
16 echo " -help show this help screen"
17 echo " -cmd show the ant command being used by the releas kit"
18 echo " ANT_ARGS additional arguments to be passed to ant"
19}
20
21#determine requested release kit
22rk_name="$(basename $0)"
23export RK_HOME="$(cd "$(dirname "$0")/.." && pwd)"
24
25if [ "$rk_name" == "rk2" ]; then
26 rk_fullname="Release Kit for Greenstone2"
27elif [ "$rk_name" == "rk3" ]; then
28 rk_fullname="Release Kit for Greenstone3"
29elif [ "$rk_name" == "sork2" ]; then
30 rk_fullname="Source Code Release Kit for Greenstone2"
31elif [ "$rk_name" == "sork3" ]; then
32 rk_fullname="Source Code Release Kit for Greenstone3"
33elif [ "$rk_name" == "cdrk2" ]; then
34 rk_fullname="CD-ROM Release Kit for Greenstone2"
35elif [ "$rk_name" == "derk" ]; then
36 rk_fullname="Documented Examples Release Kit"
37elif [ "$rk_name" == "clientrk" ]; then
38 rk_fullname="Standalone Client-GLI Release Kit"
39else
40 show_help
41 exit
42fi
43
44#make sure ant has enough memory
45export ANT_OPTS=-Xmx1024M
46
47#create the command
48toexec="ant -lib \"`pwd`/installer/classes\" -f \"$RK_HOME/kits/$rk_name/ant-scripts/build.xml\" \"-Dbasedir=`pwd`\" \"-Drk.home=$RK_HOME\" \"-Drk.name=$rk_name\""
49
50# Generally, an ant property can be true|on|yes vs false|off|no (or left unset)
51# see https://ant.apache.org/manual/properties.html#if+unless
52# However, the release-kit code requires envvar KEEP_SRC to be "true" in order to stop it deleting source code
53# set KEEP_SRC env var here or in envi/etc/tasks/snapshot/environment.pl
54#KEEP_SRC=true
55#echo "KEEP_SRC: $KEEP_SRC"
56if test -n $KEEP_SRC ; then
57 toexec="$toexec \"-Dkeep.src=$KEEP_SRC\""
58fi
59
60#pass on the arguments
61while [ "$1" != "" ]; do
62
63 if [ "$1" == "-help" ]; then
64 show_help
65 exit
66 elif [ "$1" == "-cmd" ]; then
67 show_cmd=true
68 else
69 toexec="$toexec \"$1\""
70 fi
71 shift
72
73done
74
75#show the command to be executed
76if [ "$show_cmd" == "true" ]; then
77 echo $toexec
78#execute
79else
80 show_title | tee ${rk_name}.out
81 $toexec 2>&1 | tee -a ${rk_name}.out
82fi
83
Note: See TracBrowser for help on using the repository browser.