Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Williams2014-07-28 19:04:19 +0000
committerDavid Williams2014-07-28 19:04:19 +0000
commit1897d929b5d31a8a7ce9f38316110e61dc98d529 (patch)
tree5e4f2888107da7da672db9a33ace301b1a57b2dc /production/bootstrapVariables.shsource
parent164a895b467feedc21dc161cac22ab6f6e6832c2 (diff)
downloadeclipse.platform.releng.aggregator-1897d929b5d31a8a7ce9f38316110e61dc98d529.tar.gz
eclipse.platform.releng.aggregator-1897d929b5d31a8a7ce9f38316110e61dc98d529.tar.xz
eclipse.platform.releng.aggregator-1897d929b5d31a8a7ce9f38316110e61dc98d529.zip
Bug 409190 - [restore test] restore some releng tests
Bug 411317 - Need to remove some "PDE Transition" code Bug 387872 - BuildTests has no test that reports failures in platform.doc.isv.schema.txt
Diffstat (limited to 'production/bootstrapVariables.shsource')
-rw-r--r--production/bootstrapVariables.shsource134
1 files changed, 134 insertions, 0 deletions
diff --git a/production/bootstrapVariables.shsource b/production/bootstrapVariables.shsource
new file mode 100644
index 000000000..b58f31368
--- /dev/null
+++ b/production/bootstrapVariables.shsource
@@ -0,0 +1,134 @@
+#!/usr/bin/env bash
+# boot strap basic variable values, to drive Eclipse Platform builds.
+
+# we set RAWDATE first thing, just to make it more accurate of "start of build"
+if [[ -z "${RAWDATE}" ]]
+then
+ RAWDATE=$( date +%s )
+ export RAWDATE
+fi
+
+source "${SCRIPT_PATH}/bashUtilities.shsource"
+
+# USAGE: fn-git-cache BUILD_ROOT
+# ROOT: /shared/eclipse/builds/${major}${type}
+fn-git-cache ()
+{
+ # we (now) leave branch our of git-cache path, or else "topic branches", such as
+ # 'david_williams/II20130409-0900' complicates directory structure
+ checkNArgs $# 1
+ if [[ $? != 0 ]]; then return 1; fi
+ ROOT="$1"; shift
+ echo $ROOT/gitCache
+}
+# USAGE: fn-git-dir GIT_CACHE URL
+# GIT_CACHE: /shared/eclipse/builds/R4_2_maintenance/gitCache
+# URL: file:///gitroot/platform/eclipse.platform.releng.aggregator.git
+fn-git-dir ()
+{
+ checkNArgs $# 2
+ if [[ $? != 0 ]]; then return 1; fi
+ GIT_CACHE="$1"; shift
+ URL="$1"; shift
+ echo $GIT_CACHE/$( basename "$URL" .git )
+}
+
+
+# USAGE: fn-build-id BUILD_TYPE
+# BUILD_TYPE: I, M, N, X, Y, P
+
+fn-build-id ()
+{
+ checkNArgs $# 1
+ if [[ $? != 0 ]]; then return 1; fi
+ BUILD_TYPE="$1"; shift
+ TIMESTAMP=$( date +%Y%m%d-%H%M --date='@'$RAWDATE )
+ echo ${BUILD_TYPE}${TIMESTAMP}
+}
+
+
+# USAGE: fn-build-dir ROOT BUILD_ID STREAM
+# ROOT: /shared/eclipse/builds
+# BUILD_ID: M20121119-1900
+# STREAM: 4.3.0
+fn-build-dir ()
+{
+ checkNArgs $# 3
+ if [[ $? != 0 ]]; then return 1; fi
+ ROOT="$1"; shift
+ BUILD_ID="$1"; shift
+ STREAM="$1"; shift
+ eclipseStreamMajor=${STREAM:0:1}
+ dropDirSegment=siteDir/eclipse/downloads/drops
+ if (( $eclipseStreamMajor > 3 ))
+ then
+ dropDirSegment=siteDir/eclipse/downloads/drops4
+ fi
+ echo $ROOT/$dropDirSegment/$BUILD_ID
+}
+
+
+ # if not defined "externally", we use default for eclipse.org
+ if [[ -z "${REPO_AND_ACCESS}" ]]
+ then
+ # unless we are on 'build' machine
+ if [[ "build" == "$(hostname)" ]]
+ then
+ export REPO_AND_ACCESS=file:///gitroot
+ else
+ export REPO_AND_ACCESS=git://git.eclipse.org/gitroot
+ fi
+ fi
+
+ if [[ -z "${AGGREGATOR_REPO}" ]]
+ then
+ export AGGREGATOR_REPO=${REPO_AND_ACCESS}/platform/eclipse.platform.releng.aggregator.git
+ fi
+
+ assertNotEmpty BUILD_ROOT
+ assertNotEmpty AGGREGATOR_REPO
+ assertNotEmpty BUILD_TYPE
+ assertNotEmpty STREAM
+
+ if [[ -z "${gitCache}" ]]
+ then
+ gitCache=$( fn-git-cache "${BUILD_ROOT}" )
+ assertNotEmpty gitCache
+ export gitCache
+ else
+ echo "gitCache was already defined as $gitCache"
+ fi
+
+ if [[ -z "${aggDir}" ]]
+ then
+ aggDir=$( fn-git-dir "$gitCache" "$AGGREGATOR_REPO" )
+ assertNotEmpty aggDir
+ export aggDir
+ else
+ echo "aggDir was already defined as $aggDir"
+ fi
+
+ if [[ -z "${BUILD_ID}" ]]
+ then
+ BUILD_ID=$(fn-build-id "$BUILD_TYPE" )
+ assertNotEmpty BUILD_ID
+ export BUILD_ID
+ else
+ echo "BUILD_ID was already defined as $BUILD_ID"
+ fi
+
+ if [[ -z "${buildDirectory}" ]]
+ then
+ buildDirectory=$( fn-build-dir "$BUILD_ROOT" "$BUILD_ID" "$STREAM" )
+ assertNotEmpty buildDirectory
+ export buildDirectory
+ # this should be when we first create buildDirectory
+ echo "Making buildDirectory: ${buildDirectory}"
+ mkdir -p "${buildDirectory}"
+ # it appears GID bit is not always set correctly, so we'll do so explicitly
+ chmod -c g+s "${buildDirectory}"
+ else
+ echo "buildDirectory was already defined as $buildDirectory"
+ fi
+
+

Back to the top