root/trunk/build/quickstart/linux/bw

Revision 1943 (checked in by douglm, 5 years ago)

move scripts

  • Property svn:mergeinfo set to
  • Property svn:executable set to *
Line 
1 #! /bin/sh
2
3 #
4 # This file is included by the quickstart script file "bw" so that it can live
5 # within the svn repository.
6 #
7
8 ANT_HOME=`dirname "$PRG"`/apache-ant-1.7.0
9 ANT_HOME=`cd "$ANT_HOME" && pwd`
10
11 echo ""
12 echo ""
13 echo "  Bedework Calendar System"
14 echo "  ------------------------"
15 echo ""
16
17 PRG="$0"
18
19 usage() {
20   echo "  $PRG [ -quickstart | -bwchome path ] [ -bwc configname ] [ -offline } [ target ] "
21   echo ""
22   echo "     -quickstart  Use the current quickstart configurations "
23   echo "     -bwchome     Specify path to configurations"
24   echo "     -bwc         Specify configuration name"
25   echo "     -offline     Build without atempting to retrieve library jars"
26   echo "     target       Ant target to execute"
27   echo ""
28   echo "   Invokes ant to build or deploy the bedework system. Uses a configuration"
29   echo "   directory which contains one directory per configuration."
30   echo ""
31   echo "   Within each configuration directory we expect a file called build.properties"
32   echo "   which should point to the property and options file needed for the deploy process"
33   echo ""
34   echo "   In general these files will be in the same directory as build.properties."
35   echo "   The environment variable BEDEWORK_CONFIG contains the path to the current"
36   echo "   configuration directory and can be used to build a path to the other files."
37   echo ""
38 }
39
40 errorUsage() {
41   echo "*******************************************************"
42   echo "Error: $1"
43   echo "*******************************************************"
44   usage
45   exit 1
46 }
47
48 saveddir=`pwd`
49
50 export QUICKSTART_HOME=$saveddir
51
52 # Default some parameters
53
54 BWCONFIGS=
55 bwc=default
56 BWCONFIG=
57 offline=
58 quickstart=
59
60 if [ "$1" = "" ] ; then
61   usage
62   exit 1
63 fi
64
65 while [ "$1" != "" ]
66 do
67   # Process the next arg
68   case $1       # Look at $1
69   in
70     -bwchome)         # Define location of configs
71       shift
72       BWCONFIGS="$1"
73       shift
74       ;;
75     -quickstart)
76       quickstart="yes"
77       shift
78       ;;
79     -usage | -help | -? | ?)
80       usage
81       exit
82       shift
83       ;;
84     -bwc)
85       shift
86       bwc="$1"
87       shift
88       ;;
89     -offline)
90       offline="-Dorg.bedework.offline.build=yes"
91       shift
92       ;;
93     -*)
94       usage
95       exit 1
96       ;;
97     *)
98       # Assume we've reached the target(s)
99       break
100       ;;
101   esac
102 done
103
104 if [ "$quickstart" != "" ] ; then
105   if [ "$BWCONFIGS" != "" ] ; then
106     errorUsage "Cannot specify both -quickstart and -bwchome"
107   fi
108
109   BWCONFIGS=$QUICKSTART_HOME/bedework/config/bwbuild
110 elif [ "$BWCONFIGS" = "" ] ; then
111   BWCONFIGS=$HOME/bwbuild
112 fi
113
114 export BEDEWORK_CONFIGS_HOME=$BWCONFIGS
115 export BEDEWORK_CONFIG=$BWCONFIGS/$bwc
116
117 if [ ! -f "$BEDEWORK_CONFIG/build.properties" ] ; then
118   errorUsage "Configuration $BEDEWORK_CONFIG does not exist or is not a bedework configuration."
119 fi
120
121 if [ -z "$JAVA_HOME" -o ! -d "$JAVA_HOME" ] ; then
122   errorUsage "JAVA_HOME is not defined correctly for bedework."
123 fi
124
125 # Make available for ant
126 export BWCONFIG="-Dorg.bedework.user.build.properties=$BEDEWORK_CONFIG/build.properties"
127
128 echo "BWCONFIGS=$BWCONFIGS"
129 echo "BWCONFIG=$BWCONFIG"
130
131 CLASSPATH=$ANT_HOME/lib/ant-launcher.jar
132
133 $JAVA_HOME/bin/java -classpath $CLASSPATH $offline -Dant.home=$ANT org.apache.tools.ant.launch.Launcher $BWCONFIG $*
Note: See TracBrowser for help on using the browser.