diff options
author | David Williams | 2013-03-05 04:18:33 +0000 |
---|---|---|
committer | David Williams | 2013-03-05 04:18:33 +0000 |
commit | d37f57664a8d162de252ff55d7294747c65742f0 (patch) | |
tree | 03c889ec2a03cfd194fb76a1da27648499cf48d4 /production | |
parent | 08af34b5209fea81a2e048240858252f993cfd01 (diff) | |
download | eclipse.platform.releng.aggregator-d37f57664a8d162de252ff55d7294747c65742f0.tar.gz eclipse.platform.releng.aggregator-d37f57664a8d162de252ff55d7294747c65742f0.tar.xz eclipse.platform.releng.aggregator-d37f57664a8d162de252ff55d7294747c65742f0.zip |
Bug 402063 - [CBI] Generate Deployable build directory including repo
Diffstat (limited to 'production')
-rw-r--r-- | production/sdk/promotion/synchUpdateUtils.shshource | 379 |
1 files changed, 0 insertions, 379 deletions
diff --git a/production/sdk/promotion/synchUpdateUtils.shshource b/production/sdk/promotion/synchUpdateUtils.shshource deleted file mode 100644 index 8722d9963..000000000 --- a/production/sdk/promotion/synchUpdateUtils.shshource +++ /dev/null @@ -1,379 +0,0 @@ -#!/usr/bin/env bash - - -function dropOnDLServer() -{ - eclipseStream=$1 - if [[ -z "${eclipseStream}" ]] - then - printf "\n\n\t%s\n\n" "ERROR: Must provide eclipseStream as first argumnet, for this function $(basename $0)" >&2 - return 1; - fi - - - buildId=$2 - if [[ -z "${buildId}" ]] - then - printf "\n\n\t%s\n\n" "ERROR: Must provide buildType as second argumnet, for this function $(basename $0)" >&2 - return 1; - fi - - BUILD_TECH=$3 - if [[ -z "${BUILD_TECH}" ]] - then - printf "\n\n\t%s\n\n" "ERROR: Must provide BUILD_TECH as third argumnet, for this function $(basename $0)" >&2 - return 1; - fi - - pathToDL=$( dlToPath "$eclipseStream" "$buildId" "$BUILD_TECH" ) - - if [[ "$pathToDL" == 1 ]] - then - printf "\n\n\t%s\n\n" "ERROR: pathToDL could not be computed." >&2 - return 1 - fi - toDir="/home/data/httpd/download.eclipse.org/${pathToDL}" - echo $toDir -} -function updateSiteOnDL() -{ - eclipseStream=$1 - if [[ -z "${eclipseStream}" ]] - then - printf "\n\n\t%s\n\n" "ERROR: Must provide eclipseStream as first argumnet, for this function $(basename $0)" >&2 - return 1; - fi - - - buildId=$2 - if [[ -z "${buildId}" ]] - then - printf "\n\n\t%s\n\n" "ERROR: Must provide buildType as second argumnet, for this function $(basename $0)" >&2 - return 1; - fi - - BUILD_TECH=$3 - if [[ -z "${BUILD_TECH}" ]] - then - printf "\n\n\t%s\n\n" "ERROR: Must provide BUILD_TECH as third argumnet, for this function $(basename $0)" >&2 - return 1; - fi - - # contrary to intuition (and previous behavior, bash 3.1) do NOT use quotes around right side of expression. - if [[ "${eclipseStream}" =~ ([[:digit:]]*)\.([[:digit:]]*)\.([[:digit:]]*) ]] - then - eclipseStreamMajor=${BASH_REMATCH[1]} - eclipseStreamMinor=${BASH_REMATCH[2]} - eclipseStreamService=${BASH_REMATCH[3]} - else - echo "ERROR: eclipseStream, $eclipseStream, must contain major, minor, and service versions, such as 4.2.0" >&2 - exit 1 - fi - buildType=${buildId:0:1} - - toSiteDir="/home/data/httpd/download.eclipse.org/eclipse/updates" - - if [[ "${BUILD_TECH}" == 'CBI' ]] - then - updatesSuffix="builds" - elif [[ "${BUILD_TECH}" == 'PDE' ]] - then - updatesSuffix="buildspdebased" - else - echo "ERROR: Unexpected value of BUILD_TECH, $BUILD_TECH" >&2 - fi - - toMainUpdateDir=$toSiteDir/${eclipseStreamMajor}.${eclipseStreamMinor}-${buildType}-${updatesSuffix}/ - echo $toMainUpdateDir -} -# compute update site on build server -function updateSiteOnBuildDir() -{ - eclipseStream=$1 - if [[ -z "${eclipseStream}" ]] - then - printf "\n\n\t%s\n\n" "ERROR: Must provide eclipseStream as first argumnet, for this function $(basename $0)" >&2 - return 1; - fi - - - buildId=$2 - if [[ -z "${buildId}" ]] - then - printf "\n\n\t%s\n\n" "ERROR: Must provide buildType as second argumnet, for this function $(basename $0)" >&2 - return 1; - fi - - BUILD_TECH=$3 - if [[ -z "${BUILD_TECH}" ]] - then - printf "\n\n\t%s\n\n" "ERROR: Must provide BUILD_TECH as third argumnet, for this function $(basename $0)" >&2 - return 1; - fi - - # contrary to intuition (and previous behavior, bash 3.1) do NOT use quotes around right side of expression. - if [[ "${eclipseStream}" =~ ([[:digit:]]*)\.([[:digit:]]*)\.([[:digit:]]*) ]] - then - eclipseStreamMajor=${BASH_REMATCH[1]} - eclipseStreamMinor=${BASH_REMATCH[2]} - eclipseStreamService=${BASH_REMATCH[3]} - else - echo "eclipseStream, $eclipseStream, must contain major, minor, and service versions, such as 4.2.0" >&2 - return 1 - fi - buildType=${buildId:0:1} - - if [[ "${BUILD_TECH}" == 'CBI' ]] - then - buildRoot=/shared/eclipse/builds/${eclipseStreamMajor}${buildType} - elif [[ "${BUILD_TECH}" == 'PDE' ]] - then - buildRoot=/shared/eclipse/eclipse${eclipseStreamMajor}${buildType} - else - echo "ERROR: Unexpected value of BUILD_TECH, $BUILD_TECH" >&2 - return 1 - fi - - - - if [[ "${BUILD_TECH}" == 'CBI' ]] - then - #TODO: need branch! or ... guess with "find" - if [[ -z "${BRANCH}" ]] - then - BRANCH=master - fi - siteDir=${buildRoot}/siteDir - updatesSuffix="builds" - fromDir=$siteDir/updates/${eclipseStreamMajor}.${eclipseStreamMinor}-${buildType}-${updatesSuffix}/${buildId} - mkdir -p ${fromDir} - # for now, straight copy from what was produced to local build machine directory. This is done so that - # Rest of scripts stay common - # Eventually, we might put in some mirror/comparator tasks (just as sanity check on new build ... should be impossible since new build does that early-on?) - # and mirror in EMF too? Here for now, POM later? - # - # full form is simiilar to - # ${buildRoot}/${BRANCH}/gitCache/eclipse.platform.releng.aggregator/eclipse.platform.repository/target/repository - find ${buildRoot} -regex ".*/gitCache/eclipse.platform.releng.aggregator/eclipse.platform.repository/target/repository" -execdir rsync -vr ./repository/ "${fromDir}/" \; - elif [[ "${BUILD_TECH}" == 'PDE' ]] - then - siteDir=${buildRoot}/siteDir - updatesSuffix="builds" - fromDir=$siteDir/updates/${eclipseStreamMajor}.${eclipseStreamMinor}-${buildType}-${updatesSuffix}/${buildId} - else - echo "ERROR: Unexpected value of BUILD_TECH, $BUILD_TECH" >&2 - return 1 - fi - - echo $fromDir -} - -# compute main part of download server drop directory -function dropFromBuildDir() -{ - - eclipseStream=$1 - buildId=$2 - BUILD_TECH=$3 - pathFromDL=$( dlFromPath "$eclipseStream" "$buildId" "$BUILD_TECH" ) - - - if [[ "$pathFromDL" == 1 ]] - then - printf "\n\n\t%s\n\n" "ERROR: pathToDL could not be computed." >&2 - return 1 - fi - - eclipseStreamMajor=${eclipseStream:0:1} - buildType=${buildId:0:1} - - if [[ "${BUILD_TECH}" == 'CBI' ]] - then - buildRoot=/shared/eclipse/builds/${eclipseStreamMajor}${buildType} - elif [[ "${BUILD_TECH}" == 'PDE' ]] - then - buildRoot=/shared/eclipse/eclipse${eclipseStreamMajor}${buildType} - else - echo "ERROR: BUILD_TECH value not recognized, $BUILD_TECH" >&2 - return 1 - fi - - siteDir=${buildRoot}/siteDir - - if [[ "${BUILD_TECH}" == 'CBI' ]] - then - fromDir=${siteDir}/${pathFromDL}/${buildId} - else - fromDir=${siteDir}/${pathFromDL}/${buildId} - fi - - echo "$fromDir" - -} - -# compute main (middle part) of download site -function dlToPath() -{ - eclipseStream=$1 - if [[ -z "${eclipseStream}" ]] - then - printf "\n\n\t%s\n\n" "ERROR: Must provide eclipseStream as first argumnet, for this function $(basename $0)" >&2 - return 1; - fi - - - buildId=$2 - if [[ -z "${buildId}" ]] - then - printf "\n\n\t%s\n\n" "ERROR: Must provide buildId as second argumnet, for this function $(basename $0)" >&2 - return 1; - fi - - BUILD_TECH=$3 - if [[ -z "${BUILD_TECH}" ]] - then - printf "\n\n\t%s\n\n" "ERROR: Must provide BUILD_TECH as third argumnet, for this function $(basename $0)" >&2 - return 1; - fi - - - - eclipseStreamMajor=${eclipseStream:0:1} - buildType=${buildId:0:1} - - #TODO: eventual switch so CBI is "normal" one and PDE is marked one - if [[ "${BUILD_TECH}" == 'CBI' ]] - then - dropsuffix="" - else - dropsuffix="pdebased" - fi - - pathToDL=eclipse/downloads/drops - if [[ $eclipseStreamMajor > 3 ]] - then - pathToDL=$pathToDL$eclipseStreamMajor - fi - - pathToDL=$pathToDL$dropsuffix - #echo "pathToDL: $pathToDL" - echo $pathToDL -} - -# compute main (left part) of download site (This is needed only for PDE?) -# because we want "from" on build machine to stay the same, only change "to" part, to be "pdebased" -function dlFromPath() -{ - eclipseStream=$1 - if [[ -z "${eclipseStream}" ]] - then - printf "\n\n\t%s\n\n" "ERROR: Must provide eclipseStream as first argumnet, for this function $(basename $0)" >&2 - return 1; - fi - - - buildId=$2 - if [[ -z "${buildId}" ]] - then - printf "\n\n\t%s\n\n" "ERROR: Must provide buildId as second argumnet, for this function $(basename $0)" >&2 - return 1; - fi - - BUILD_TECH=$3 - if [[ -z "${BUILD_TECH}" ]] - then - printf "\n\n\t%s\n\n" "ERROR: Must provide BUILD_TECH as third argumnet, for this function $(basename $0)" >&2 - return 1; - fi - - eclipseStreamMajor=${eclipseStream:0:1} - buildType=${buildId:0:1} - - - - pathFromDL=eclipse/downloads/drops - if [[ $eclipseStreamMajor > 3 ]] - then - pathFromDL=$pathFromDL$eclipseStreamMajor - fi - - echo $pathFromDL -} - - -function syncDropLocation () -{ - echo "start syncDropLocation" - eclipseStream=$1 - if [[ -z "${eclipseStream}" ]] - then - printf "\n\n\t%s\n\n" "ERROR: Must provide eclipseStream as first argumnet, for this function $(basename $0)" >&2 - return 1; - fi - echo "eclipseStream: $eclipseStream" - - buildId=$2 - if [[ -z "${buildId}" ]] - then - printf "\n\n\t%s\n\n" "ERROR: Must provide buildId as second argumnet, for this function $(basename $0)" >&2 - return 1; - fi - echo "buildId: $buildId" - - BUILD_TECH=$3 - if [[ -z "${BUILD_TECH}" ]] - then - printf "\n\n\t%s\n\n" "ERROR: Must provide BUILD_TECH as third argumnet, for this function $(basename $0)" >&2 - return 1; - fi - echo "BUILD_TECH: $BUILD_TECH" - - EBUILDER_HASH=$4 - if [[ -z "${EBUILDER_HASH}" ]] - then - printf "\n\n\t%s\n\n" "ERROR: Must provide builder (or aggregator) hash as fourth argumnet, for this function $(basename $0)" >&2 - return 1; - fi - echo "EBUILDER_HASH: $EBUILDER_HASH" - - eclipseStreamMajor=${eclipseStream:0:1} - buildType=${buildId:0:1} - - fromDir=$(dropFromBuildDir $eclipseStream $buildId $BUILD_TECH) - if [[ ! -d "${fromDir}" ]] - then - echo "ERROR: fromDir is not a directory? fromDir: ${fromDir}" - return 1 - fi - - - toDir=$(dropOnDLServer $eclipseStream $buildId $BUILD_TECH) - if [[ ! -d "${toDir}" ]] - then - echo "ERROR: toDir is not a directory? toDir: ${toDir}" - return 1 - fi - - echo " fromDir: ${fromDir}" >&2 - echo " toDir: ${toDir}" >&2 - - # here, for dl site, best not to preserve times, since (if mirrored) - # would be more accurate for mirroring system to have - # actual times (and we are copying only one specific - # sub-sirectory) (But, we do for now, for easier testing) - rsync --recursive --exclude="*org.eclipse.releng.basebuilder*" --exclude="*eclipse.platform.releng.aggregator*" "${fromDir}" "${toDir}" - rccode=$? - if [[ $rccode != 0 ]] - then - echo "ERROR: rsync did not complete normally.rccode: $rccode" - return $rccode - else - # Now update main DL page index pages, to show available - source /shared/eclipse/sdk/updateIndexFilesFunction.shsource - updateIndex $eclipseStreamMajor $BUILD_TECH - fi - - - - echo "ending syncDropLocation" -} |