root/trunk/build/bw

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

Fix up code to add a user to the directory

  • 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 saveddir=`pwd`
41
42 export QUICKSTART_HOME=$saveddir
43
44 # Default some parameters
45
46 BWCONFIGS=
47 bwc=default
48 BWCONFIG=
49 offline=
50 quickstart=
51
52 while [ "$1" != "" ]
53 do
54   # Process the next arg
55   case $1       # Look at $1
56   in
57     -bwchome)         # Define location of configs
58       shift
59       BWCONFIGS="$1"
60       shift
61       ;;
62     -quickstart)
63       quickstart="yes"
64       shift
65       ;;
66     -usage | -help | -? | ?)
67       usage
68       exit
69       shift
70       ;;
71     -bwc)
72       shift
73       bwc="$1"
74       shift
75       ;;
76     -offline)
77       offline="-Dorg.bedework.offline.build=yes"
78       shift
79       ;;
80     -*)
81       usage
82       exit 1
83       ;;
84     *)
85       # Assume we've reached the target(s)
86       break
87       ;;
88   esac
89 done
90
91 if [ "$quickstart" != "" ] ; then
92   if [ "$BWCONFIGS" != "" ] ; then
93     echo "*******************************************************"
94     echo "Error: Cannot specify both -quickstart and -bwchome"
95     echo "*******************************************************"
96     exit 1
97   fi
98
99   BWCONFIGS=$QUICKSTART_HOME/bedework/config/bwbuild
100 elif [ "$BWCONFIGS" = "" ] ; then
101   BWCONFIGS=$HOME/bwbuild
102 fi
103
104 export BEDEWORK_CONFIGS_HOME=$BWCONFIGS
105 export BEDEWORK_CONFIG=$BWCONFIGS/$bwc
106
107 if [ ! -f "$BEDEWORK_CONFIG/build.properties" ] ; then
108   echo "*******************************************************"
109   echo "Error: Configuration $BEDEWORK_CONFIG does not exist or is not a bedework configuration."
110   echo "*******************************************************"
111   exit 1
112 fi
113
114 if [ -z "$JAVA_HOME" -o ! -d "$JAVA_HOME" ] ; then
115   echo "*******************************************************"
116   echo "Error: JAVA_HOME is not defined correctly for bedework."
117   echo "*******************************************************"
118   exit 1
119 fi
120
121 # Make available for ant
122 export BWCONFIG="-Dorg.bedework.user.build.properties=$BEDEWORK_CONFIG/build.properties"
123
124 echo "BWCONFIGS=$BWCONFIGS"
125 echo "BWCONFIG=$BWCONFIG"
126
127 CLASSPATH=$ANT_HOME/lib/ant-launcher.jar
128
129 $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.