blob: 0cd82b2cb3a6aa06c5fdc7834bf53d8d9750b358 [file] [log] [blame]
#!/bin/sh
#
# ptpbuild wrapper script
#
# Usage: ptpbuild version [build_args]
#
# where version is the current PTP version being built and
# build_args are any other arguments you want to pass to the
# build script.
#
# set up anything environment specific that needs to be done before
# launching the build script in the releng project
if [ $# -lt 1 ]; then
echo "usage: ptpbuild version [build_args]"
exit 1
fi
# Version of PTP we're building
PTP_VERSION=$1; shift
# main staging directory
STAGING_DIR=/opt/public/download-staging.priv/tools/ptp/releng
# download location for builds
BUILDS_DIR=/home/www/tools/ptp/builds/$PTP_VERSION
# create the releng staging directory and go there
mkdir -p $STAGING_DIR
cd $STAGING_DIR
# make a link to the results
if [ ! -L results ]; then
ln -s org.eclipse.ptp/releng/org.eclipse.ptp.releng/results results
fi
# remove the old build
rm -fr org.eclipse.ptp
# Check out the releng project
export CVSROOT=:pserver:anonymous@dev.eclipse.org:/cvsroot/tools
cvs co org.eclipse.ptp/releng/org.eclipse.ptp.releng
# run the main script
cd org.eclipse.ptp/releng/org.eclipse.ptp.releng
sh build.sh $* 2>&1 | tee $STAGING_DIR/build.log
# Copy the build.log to where the latest build is. Only copy
# if a build.log doesn't exist, otherwise the build failed and
# we would copy over an old log file.
if [ ! -f $BUILDS_DIR/latest/build.log ]; then
cp $STAGING_DIR/build.log $BUILDS_DIR/latest
fi