Subversion Repositories DevTools

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#!/bin/bash

# Used to setup the buildtool
#       ABT_HOME    - Where the ABT config files are to be fornd
#                   - Where the ABT fixed JARs are to be found
#       ABT_JARS    - Where the buildtool distribution is to be found
#                   - JAR file will be copied from here
#       ABT_WORK    - Working directory for the buildtool
#                   - The CWD of the buildtool execution
#
#   Used by the buildtool
#       GBE_ABT                 - Indicates the JATS that it is running an an ABT environment
#       GBE_LOG                 - Path to the builtool logging directory
#       GBE_UNC                 - Web server path for error logs
#       GBE_RM_USERNAME         - Release Manager credentials
#       GBE_RM_PASSWORD         - Allowing write access to Release Manager
#       GBE_DPKG_SSH_PROPERTIES - path to ssh properties file holding ssh credentials
#
# Internal
#       JAR                     - Path to the buildtool jar
#

ABT_HOME=/work/buildtool
ABT_JARS=$GBE_DPKG/buildtool/latest/etc
ABT_WORK=/work/abt
GBE_ABT=1
GBE_LOG=/net/auperaarc01/export/devl/abtlog
GBE_UNC=http://auperaarc01/devl/abtlog
GBE_RM_USERNAME=build_user
GBE_RM_PASSWORD=frog123
GBE_DPKG_SSH_PROPERTIES=$GBE_DPKG/.dpkg_archive/fragments.properties
JAR=$ABT_HOME/abtdD.jar

export ABT_HOME GBE_ABT GBE_LOG GBE_UNC GBE_DPKG_SSH_PROPERTIES
# do not export ABT_WORK JAR

if [ "x$GBE_RM_LOCATION" = "x" ] ; then
    echo Error: Program abtlaunch
    echo Error: EnvVar GBE_RM_LOCATION not set
    echo Error: This is set within /etc/profile
    exit 1
fi

if [ "x$JAVA_HOME_1_6" = "x" ] ; then
    echo Error: Program abtlaunch
    echo Error: EnvVar JAVA_HOME_1_6 not set
    echo Error: This is set within /etc/profile
    exit 1
fi

if [ ! -x $JAVA_HOME_1_6/bin/java ] ; then
    echo Error: Program abtlaunch
    echo Error: The java program does not exist
    echo Error: Location: $JAVA_HOME_1_6/bin/java
    exit 1
fi

if [ ! -d $ABT_WORK ] ; then
    echo Error: Program abtlaunch
    echo Error: The ABT work directory does not exist
    echo Error: Dir: $ABT_WORK
    exit 1
fi

# Copy in the latest JARS
cp ${ABT_JARS}/*.jar $ABT_HOME
if [ $? -ne 0 ]; then
    echo Error: Program abtlaunch
    echo Error: Error occured copying latest builtool executables
    exit 1
fi

if [ ! -f $JAR ] ; then
    echo Error: Program abtlaunch
    echo Error: Required Jar does not exist
    exit 1
fi

PATH=$ABT_HOME:$PATH
cd $ABT_WORK
#rm -f *.log
rm -f *.xml

$JAVA_HOME_1_6/bin/java -jar $JAR