blob: e509396aa89ce5194e640d9faf11e37ad749901d [file] [log] [blame]
# !/bin/sh
#------------------------------------------------------------------------------------------------------
# This script is designed to copy test result files from a "root" location
# to the coresponding hosted location on the Eclipse Download site.
#
# Assumptions:
# - results will be stored locally in the following hierarchy:
# ${RESULTROOT}/${VERSION}/${QUALIFIER}/${HOSTNAME} (example: ${ROOT}/2.2.0/v20101116-r8433/Eclipse)
# - there is a "TestConfiguration.html" in each host dir (specific to each run)
# - the current user id matches the commiter uid at Eclipse or an alternate is specified
# - the machine running this script has setup SSH authentication for that user to dev.eclipse.org
#
# Author: Eric Gwin (Oracle)
#
#==========================
# Basic Env Setup
#
#Define common variables
CUR_DIR=`dirname .`
START_DATE=`date '+%y%m%d-%H%M'`
#Directories
#PUBLISH_HOME=/home/data/httpd/download.eclipse.org/rt/eclipselink/nightly/2.2.0/20101116/Eclipse/
PUBLISH_HOME=/home/data/httpd/download.eclipse.org/rt/eclipselink/nightly
PUBLISH_SERVER=build.eclipse.org
#==========================
# Functions Definitions
#
unset Usage
Usage() {
echo "ERROR: Invalid usage detected!"
echo "USAGE: ./`basename ${0}` RESULTROOT RESULTBUILD HOSTNAME [\> LOGFILE 2\>\&1]"
echo "Where: RESULTROOT = Path to local results hierarchy"
echo " RESULTBUILD= OSGi-like version of build tested (2.2.0.v20101116-r8433)"
echo " HOSTNAME = host conguration name"
echo " UID = optional uid of comitter publishing (assumes local user)"
echo ""
echo " Assumptions:"
echo " - results will be stored locally in the following hierarchy:"
echo " ${RESULTROOT}/${VERSION}/${QUALIFIER}/${HOSTNAME} (example: ${ROOT}/2.2.0/v20101116-r8433/Oracle1)"
echo " - there is a "TestConfiguration.html" in the host dir (specific to each run)"
echo " - there is a "ResultSummary.dat" in the host dir (specific to each run)"
echo " - the current user id matches the commiter uid at Eclipse or an alternate is specified"
echo " - the machine running this script has setup SSH authentication for that user to dev.eclipse.org"
echo ""
echo " Specifications:"
echo " TestConfiguration.html:"
echo " This file should be generated by the testing process in question. It should be a valid html"
echo " document and should specify, the hardware, OS, JDK version and manufacturer, Database brand"
echo " and version, the driver name and version as well as any other tools and their versions pertinent"
echo " to replicating the test environment. This file is direcly link to in the generated build pages."
echo " ResultSummary.dat:"
echo " This file should be generated by the testing process in question, though it may be generated by the"
echo " Ant process. It lists the result files for the host, the number of tests in suite (the historic"
echo " benchmark from previous runs used to generate status of run - less/expected/more), the number"
echo " that did run, and the number of reported errors+failures (non-zero used to flag problems) in the"
echo " following format:"
echo " <testresult_file>:<NumberInSuite>:<TestsRun>:<errors+failures>"
echo " the nightly generation script looks for the following files in order (others will be ignored):"
echo " eclipselink-core-lrg-<release version>.html"
echo " eclipselink-jpa-lrg-<release version>.html"
echo " eclipselink-jpa-wdf-lrg-<release version>.html"
echo " eclipselink-jaxb-lrg-<release version>.html"
echo " eclipselink-oxm-lrg-<release version>.html"
echo " eclipselink-sdo-lrg-<release version>.html"
echo " eclipselink-dbws-lrg-<release version>.html"
echo " eclipselink-dbws-util-lrg-<release version>.html"
echo ""
exit
}
unset parseResultBuild
parseResultBuild() {
build_version=$1
build_version_string="Error: Invalid build_version: '${build_version}'!"
## Parse for VERSION, and QUALIFIER
VERSION=`echo ${build_version} | cut -d'.' -f1-3`
QUALIFIER=`echo ${build_version} | cut -d'.' -f4`
BLDDATE=`echo ${QUALIFIER} | cut -s -d'-' -f1 | cut -d'v' -f2`
echo "VERSION='${VERSION}' QUALIFIER='${QUALIFIER}' BLDDATE='${BLDDATE}'"
}
unset validateParameters
validateParameters() {
error=false
if [ ! -d ${RESULTROOT} ] ; then
echo "Error: Publish location not found!"
echo " RESULTROOT: '${RESULTROOT}' doesn't exist!"
exit
fi
if [ ! -d ${RESULTROOT}/${VERSION} ] ; then
echo "Error: Publish location not found!"
echo " VERSION: '${RESULTROOT}/${VERSION}' doesn't exist!"
exit
fi
if [ ! -d ${RESULTROOT}/${VERSION}/${QUALIFIER} ] ; then
echo "Error: Publish location not found!"
echo " QUALIFIER: '${RESULTROOT}/${VERSION}/${QUALIFIER}' doesn't exist!"
exit
fi
if [ ! -d ${RESULTROOT}/${VERSION}/${QUALIFIER}/${HOSTNAME} ] ; then
echo "Error: Publish location not found!"
echo " HOSTNAME: '${RESULTROOT}/${VERSION}/${QUALIFIER}/${HOSTNAME}' doesn't exist!"
exit
fi
if [ ! -f ${RESULTROOT}/${VERSION}/${QUALIFIER}/${HOSTNAME}/TestConfiguration.html ] ; then
echo "Error: Test Configuration description not found!"
echo " '${RESULTROOT}/${VERSION}/${QUALIFIER}/${HOSTNAME}/TestConfiguration.html' doesn't exist!"
error=true
fi
if [ ! -f ${RESULTROOT}/${VERSION}/${QUALIFIER}/${HOSTNAME}/ResultSummary.dat ] ; then
echo "Error: ResultSummary datafile not found!"
echo " '${RESULTROOT}/${VERSION}/${QUALIFIER}/${HOSTNAME}/ResultSummary.dat' doesn't exist!"
error=true
fi
if [ "$error" = "true" ] ; then
exit
fi
}
unset publishResults
publishResults() {
RESULTPATH=${RESULTROOT}/${VERSION}/${BLDDATE}/${HOSTNAME}
HOSTPATH=${PUBLISH_SERVER}:${PUBLISH_HOME}/${VERSION}/${BLDDATE}/${HOSTNAME}
SCP_OPTIONS="-qpr"
echo "Creating Hostpath.."
echo " 'mkdir ${HOSTPATH}'"
echo "Using secure copy to publish files:"
echo " From: ${RESULTPATH}"
echo " To: ${HOSTPATH}"
#scp ${SCP_OPTIONS} ${RESULTPATH} ${HOSTPATH}
}
unset postProcess
postProcess() {
echo "PostProcessing..."
echo " Generating notification for ${PROC} publishing for ${BRANCH} build ${QUALIFIER}..."
echo " Not sent..."
# cleanup
echo "Done."
}
#==========================
# Main Begins
#
#==========================
if [ "$#" -lt 3 ] ; then
echo "Error: Incorrect number of arguments!"
Usage
fi
RESULTROOT=$1
RESULTBUILD=$2
HOSTNAME=$3
parseResultBuild ${RESULTBUILD}
validateParameters
publishResults