blob: 19e2db55f94d6f883d8478425ee01c535465cb0d [file] [log] [blame]
# !/bin/sh
#****************************************************************************************
# Copyright (c) 2012, 2013 Oracle and/or its affiliates. All rights reserved.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
# which accompanies this distribution.
#
# The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
# and the Eclipse Distribution License is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# Contributors:
# - egwin - May 2013 - Initial implementation
#****************************************************************************************
#==========================
# Basic Env Setup
#
#Define common variables
THIS=$0
PROGNAME=`basename ${THIS}`
CUR_DIR=`dirname ${THIS}`
umask 0002
PARAM=$1
#==========================
# Functions Definitions
#
unset usage
usage() {
echo "Usage: ${PROGNAME} PARAM"
echo " PARAM - exec parameter: can be 'clean', 'build', or 'test'"
}
unset clean
clean() {
# Usage: createPath path
mvn clean
cd dbws.simple
mvn clean
cd service
mvn clean
}
unset build
build() {
mvn
cd dbws.simple
mvn
echo "**** Build complete. Deploy the generated war file, then run '$PROGNAME test'. ****"
}
unset test
test() {
cd dbws.simple/service
mvn
mvn site surefire-report:report-only
}
#==========================
# Main Begins
#==========================
# Validate run parameters
if [ "${PARAM}" = "" ] ; then
usage
echo " "
echo "No parameter specified! Exiting..."
exit 1
fi
if [ "${PARAM}" = "clean" ] ; then
clean
echo " "
else if [ "${PARAM}" = "build" ] ; then
build
echo " "
else if [ "${PARAM}" = "test" ] ; then
test
echo " "
else
usage
echo "${PARAM} not recognized as a valid option."
fi
fi
fi