blob: 34f14ecf552d59637f3f1f2026e576b70cdd1012 [file] [log] [blame]
#!/bin/sh
#!/usr/bin/env bash
#
# Script to promote the latest build in the specified committers area
#
function usage() {
printf "\n\tUsage: %s [-h] | [-v] -b buildrepositorypath " $(basename $0) >&2
printf "\n\t\t%s\n\n" "where <buildrepositorypath> is similar to /shared/webtools/committers/wtp-R3.0-R/20080611172140/R-3.0-20080611172140/updateSite" >&2
}
while getopts 'vhb:' OPTION
do
case $OPTION in
h) usage
exit 1
;;
v) verboseFlag=1
;;
b) buildrepositorypath=$OPTARG
;;
?) usage
exit 2
;;
esac
done
shift $(($OPTIND - 1))
# check we have the buildrepositorypath
if [ -z $buildrepositorypath ]
then
printf "\n\t%s\n" "Error: buildrepositorypath is required." >&2
usage
exit 1
fi
echo "buildrepositorypath: " $buildrepositorypath
if [ -z $BUILD_INITIALIZED ]
then
source properties.shsource
export BUILD_INITIALIZED=1
fi
${JAVA_HOME}/bin/java -jar featureFileCreate.jar $buildrepositorypath
if [ "$?" -ne "0" ]
then
exit $?
fi
# copy to the build repository just for safe keeping, to be used later, if needed
if [ -e wtp.sc ]
then
cp wtp.sc $buildrepositorypath
fi
if [ -e features-ganymede-wtp.xml ]
then
cp features-ganymede-wtp.xml $buildrepositorypath
fi
if [ -e features-europa-wtp.xml ]
then
cp features-europa-wtp.xml $buildrepositorypath
fi