| | 7 | PRG="$0" |
|---|
| | 8 | |
|---|
| | 9 | usage() { |
|---|
| | 10 | echo "$PRG [-bwchome path | -quickstart ] [ -bwc configname ] [ -offline } [ target ] " |
|---|
| | 11 | echo "" |
|---|
| | 12 | echo " -bwchome specify path to configurations" |
|---|
| | 13 | echo " -quickstart Use the current quickstart configurations " |
|---|
| | 14 | echo " - bwc specify configuration name" |
|---|
| | 15 | echo " -offline build without atempting to retrieve library jars" |
|---|
| | 16 | echo " target ant target to execute" |
|---|
| | 17 | echo "" |
|---|
| | 18 | echo "Invokes ant to build or deploy the bedework system. Uses a configuration" |
|---|
| | 19 | echo "directory which contains one directory per configuration." |
|---|
| | 20 | echo "" |
|---|
| | 21 | echo "Within each configuration directory we expect a file called build.properties" |
|---|
| | 22 | echo "which should point to the proerty and options file needed for th edeploy process" |
|---|
| | 23 | echo "" |
|---|
| | 24 | echo "In general these files will be in the same directory as build.properties." |
|---|
| | 25 | echo "The environment variable BEDEWORK_CONFIG contains the path to the current" |
|---|
| | 26 | echo "configuration directory and can be used to build a path to the other files." |
|---|
| | 27 | echo "" |
|---|
| | 28 | } |
|---|
| | 29 | |
|---|
| | 30 | saveddir=`pwd` |
|---|
| | 31 | |
|---|
| | 32 | export QUICKSTART_HOME=$saveddir |
|---|
| | 33 | |
|---|
| | 34 | # Default some parameters |
|---|
| | 35 | |
|---|
| | 36 | BWCONFIGS= |
|---|
| | 37 | bwc=default |
|---|
| | 38 | BWCONFIG= |
|---|
| | 39 | offline= |
|---|
| | 40 | quickstart= |
|---|
| | 41 | |
|---|
| | 42 | while [ "$1" != "" ] |
|---|
| | 43 | do |
|---|
| | 44 | # Process the next arg |
|---|
| | 45 | case $1 # Look at $1 |
|---|
| | 46 | in |
|---|
| | 47 | -bwchome) # Define location of configs |
|---|
| | 48 | shift |
|---|
| | 49 | BWCONFIGS="$1" |
|---|
| | 50 | shift |
|---|
| | 51 | ;; |
|---|
| | 52 | -quickstart) |
|---|
| | 53 | quickstart="yes" |
|---|
| | 54 | shift |
|---|
| | 55 | ;; |
|---|
| | 56 | -usage | -help | -? | ?) |
|---|
| | 57 | usage |
|---|
| | 58 | exit |
|---|
| | 59 | shift |
|---|
| | 60 | ;; |
|---|
| | 61 | -bwc) |
|---|
| | 62 | shift |
|---|
| | 63 | bwc="$1" |
|---|
| | 64 | shift |
|---|
| | 65 | ;; |
|---|
| | 66 | -offline) |
|---|
| | 67 | offline="-Dorg.bedework.offline.build=yes" |
|---|
| | 68 | shift |
|---|
| | 69 | ;; |
|---|
| | 70 | -*) |
|---|
| | 71 | usage |
|---|
| | 72 | exit 1 |
|---|
| | 73 | ;; |
|---|
| | 74 | *) |
|---|
| | 75 | # Assume we've reached the target(s) |
|---|
| | 76 | break |
|---|
| | 77 | ;; |
|---|
| | 78 | esac |
|---|
| | 79 | done |
|---|
| | 80 | |
|---|
| | 81 | if [ "$quickstart" != "" ] ; then |
|---|
| | 82 | if [ "$BWCONFIGS" != "" ] ; then |
|---|
| | 83 | echo "*******************************************************" |
|---|
| | 84 | echo "Error: Cannot specify both -quickstart and -bwchome" |
|---|
| | 85 | echo "*******************************************************" |
|---|
| | 86 | exit 1 |
|---|
| | 87 | fi |
|---|
| | 88 | |
|---|
| | 89 | BWCONFIGS=$QUICKSTART_HOME/bedework/config/bwbuild |
|---|
| | 90 | elif [ "$BWCONFIGS" = "" ] ; then |
|---|
| | 91 | BWCONFIGS=$HOME/bwbuild |
|---|
| | 92 | fi |
|---|
| | 93 | |
|---|
| | 94 | export BEDEWORK_CONFIGS_HOME=$BWCONFIGS |
|---|
| | 95 | export BEDEWORK_CONFIG=$BWCONFIGS/$bwc |
|---|
| | 96 | |
|---|
| | 97 | if [ ! -f "$BEDEWORK_CONFIG/build.properties" ] ; then |
|---|
| | 98 | echo "*******************************************************" |
|---|
| | 99 | echo "Error: Configuration $BEDEWORK_CONFIG does not exist or is not a bedework configuration." |
|---|
| | 100 | echo "*******************************************************" |
|---|
| | 101 | exit 1 |
|---|
| | 102 | fi |
|---|