diff options
| author | Paul Webster | 2012-11-16 18:08:59 +0000 |
|---|---|---|
| committer | Paul Webster | 2012-11-16 18:08:59 +0000 |
| commit | 7689c85b076c3592dd982022344b93e1c63650e3 (patch) | |
| tree | 43568156be406e3a28fd2aa215de883c3b3747a8 | |
| parent | 7fc6424be36f37ead65f5d693cbba794b5ea110b (diff) | |
| download | eclipse.platform.releng.aggregator-7689c85b076c3592dd982022344b93e1c63650e3.tar.gz eclipse.platform.releng.aggregator-7689c85b076c3592dd982022344b93e1c63650e3.tar.xz eclipse.platform.releng.aggregator-7689c85b076c3592dd982022344b93e1c63650e3.zip | |
Bug 393925 - [CBI] replace auto-tagging
update-build-input.sh will update all repos to their latest
branch tip based on the repositories.txt file
tag-build-input.sh will tag the current state of the aggregator
and submodules as the input for that build
| -rw-r--r-- | scripts/build-functions.sh | 56 | ||||
| -rw-r--r-- | scripts/build_eclipse_org.env | 2 | ||||
| -rw-r--r-- | scripts/git-submodule-checkout.sh | 22 | ||||
| -rw-r--r-- | scripts/repositories.txt | 25 | ||||
| -rw-r--r-- | scripts/tag-build-input.sh | 38 | ||||
| -rw-r--r-- | scripts/update-build-input.sh | 38 |
6 files changed, 177 insertions, 4 deletions
diff --git a/scripts/build-functions.sh b/scripts/build-functions.sh index b95240229..8039e8f8e 100644 --- a/scripts/build-functions.sh +++ b/scripts/build-functions.sh @@ -48,8 +48,8 @@ fn-git-clean () { # USAGE: fn-git-reset fn-git-reset () { - echo git reset --hard HEAD - git reset --hard HEAD + echo git reset --hard $@ + git reset --hard $@ } # USAGE: fn-git-clean-submodules @@ -121,10 +121,10 @@ fn-git-clean-aggregator () { BRANCH="$1"; shift pushd "$AGGREGATOR_DIR" fn-git-clean - fn-git-reset fn-git-clean-submodules fn-git-reset-submodules fn-git-checkout "$BRANCH" + fn-git-reset origin/$BRANCH popd } @@ -212,3 +212,53 @@ fn-maven-build-aggregator () { -Dmaven.repo.local=$LOCAL_REPO popd } + +# USAGE: fn-submodule-checkout BUILD_ID REPO_DIR REPOSITORIES_TXT +# BUILD_ID: M20121116-1100 +# REPO_DIR: /shared/eclipse/builds/R4_2_maintenance/gitCache/eclipse.platform.releng.aggregator +# SCRIPT: /shared/eclipse/builds/scripts/git-submodule-checkout.sh +# REPOSITORIES_TXT: /shared/eclipse/builds/scripts/repositories.txt +fn-submodule-checkout () { + BUILD_ID="$1"; shift + REPO_DIR="$1"; shift + SCRIPT="$1"; shift + REPOSITORIES_TXT="$1"; shift + pushd "$REPO_DIR" + git submodule foreach "/bin/bash $SCRIPT $REPOSITORIES_TXT \$name" + uninit=$( git submodule | grep "^-" | cut -f2 -d" " | sort -u ) + if [ ! -z "$uninit" ]; then + echo Some modules are not initialized: $uninit + return + fi + conflict=$( git submodule | grep "^U" | cut -f2 -d" " | sort -u ) + if [ ! -z "$conflict" ]; then + echo Some modules have conflicts: $conflict + return + fi + adds=$( git submodule | grep "^+" | cut -f2 -d" " ) + if [ -z "$adds" ]; then + echo No updates for the submodules + return + fi + echo git add $adds + git add $adds + git commit -m "Update to include new content for $BUILD_ID" + git push origin HEAD + popd +} + + +# USAGE: fn-submodule-checkout BUILD_ID REPO_DIR REPOSITORIES_TXT +# BUILD_ID: M20121116-1100 +# REPO_DIR: /shared/eclipse/builds/R4_2_maintenance/gitCache/eclipse.platform.releng.aggregator +# REPOSITORIES_TXT: /shared/eclipse/builds/scripts/repositories.txt +fn-tag-build-inputs () { + BUILD_ID="$1"; shift + REPO_DIR="$1"; shift + REPOSITORIES_TXT="$1"; shift + pushd "$REPO_DIR" + git submodule foreach "if grep \"^\${name}:\" $REPOSITORIES_TXT >/dev/null; then git tag $BUILD_ID; git push origin $BUILD_ID; else echo Skipping \$name; fi" + git tag $BUILD_ID + git push origin $BUILD_ID + popd +} diff --git a/scripts/build_eclipse_org.env b/scripts/build_eclipse_org.env index fead452cf..c31f433cf 100644 --- a/scripts/build_eclipse_org.env +++ b/scripts/build_eclipse_org.env @@ -14,6 +14,6 @@ JAVA_HOME=/opt/public/common/jdk1.7.0 MAVEN_OPTS=-Xmx2048m MAVEN_PATH=/opt/public/common/apache-maven-3.0.4/bin -# BUILD_ID=M20121115-1330 +BUILD_ID=M20121116-1300 COMPARATOR=true SIGNING=false diff --git a/scripts/git-submodule-checkout.sh b/scripts/git-submodule-checkout.sh new file mode 100644 index 000000000..a48572c1d --- /dev/null +++ b/scripts/git-submodule-checkout.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# + +REPOSITORIES_TXT="$1"; shift +name="$1"; shift + +VAL=$( grep "^${name}:" "$REPOSITORIES_TXT" | cut -f2 -d" ") +if [ -z "$VAL" ]; then + echo No tag or branch specified for $name + exit +fi + +git fetch + +if [ -z "$(git tag -l $VAL)"]; then + echo Updating branch $VAL + git checkout $VAL + git pull +else + echo Updating to tag $VAL + git checkout $VAL +fi diff --git a/scripts/repositories.txt b/scripts/repositories.txt new file mode 100644 index 000000000..03274c715 --- /dev/null +++ b/scripts/repositories.txt @@ -0,0 +1,25 @@ +rt.equinox.binaries: v20120511-1552 +rt.equinox.bundles: R3_8_maintenance +rt.equinox.framework: R3_8_maintenance +rt.equinox.incubator: R3_8_maintenance +rt.equinox.p2: R3_8_maintenance +eclipse.jdt.core.binaries: R3_8_maintenance +eclipse.jdt.core: R3_8_maintenance +eclipse.jdt.debug: R3_8_maintenance +eclipse.jdt: R3_8_maintenance +eclipse.jdt.ui: R3_8_maintenance +eclipse.pde: R3_8_maintenance +eclipse.pde.build: R3_8_maintenance +eclipse.pde.ui: R3_8_maintenance +eclipse.platform.debug: R3_8_maintenance +eclipse.platform.resources: R3_8_maintenance +eclipse.platform: R4_2_maintenance +eclipse.platform.common: R4_2_maintenance +eclipse.platform.releng: R4_2_maintenance +eclipse.platform.runtime: R4_2_maintenance +eclipse.platform.swt: R4_2_maintenance +eclipse.platform.swt.binaries: R4_2_maintenance +eclipse.platform.team: R3_8_maintenance +eclipse.platform.text: R3_8_maintenance +eclipse.platform.ua: R3_8_maintenance +eclipse.platform.ui: R4_2_maintenance diff --git a/scripts/tag-build-input.sh b/scripts/tag-build-input.sh new file mode 100644 index 000000000..d7b301b2c --- /dev/null +++ b/scripts/tag-build-input.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# + +if [ $# -ne 1 ]; then + echo USAGE: $0 env_file + exit 1 +fi + +if [ ! -r "$1" ]; then + echo "$1" cannot be read + echo USAGE: $0 env_file + exit 1 +fi + +pushd $( dirname $0 ) >/dev/null +SCRIPT_PATH=$(pwd) +popd >/dev/null + +. $SCRIPT_PATH/build-functions.sh + +. "$1" + + +cd $BUILD_ROOT + +# derived values +gitCache=$( fn-git-cache "$BUILD_ROOT" "$BRANCH" ) +aggDir=$( fn-git-dir "$gitCache" "$AGGREGATOR_REPO" ) +repositories=$( echo $SCRIPT_PATH/repositories.txt ) + + + +if [ -z "$BUILD_ID" ]; then + BUILD_ID=$(fn-build-id "$BUILD_TYPE" ) +fi + + +fn-tag-build-inputs "$BUILD_ID" "$aggDir" "$repositories" diff --git a/scripts/update-build-input.sh b/scripts/update-build-input.sh new file mode 100644 index 000000000..63fe6a609 --- /dev/null +++ b/scripts/update-build-input.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# + +if [ $# -ne 1 ]; then + echo USAGE: $0 env_file + exit 1 +fi + +if [ ! -r "$1" ]; then + echo "$1" cannot be read + echo USAGE: $0 env_file + exit 1 +fi + +pushd $( dirname $0 ) >/dev/null +SCRIPT_PATH=$(pwd) +popd >/dev/null + +. $SCRIPT_PATH/build-functions.sh + +. "$1" + + +cd $BUILD_ROOT + +# derived values +gitCache=$( fn-git-cache "$BUILD_ROOT" "$BRANCH" ) +aggDir=$( fn-git-dir "$gitCache" "$AGGREGATOR_REPO" ) +repositories=$( echo $SCRIPT_PATH/repositories.txt ) +repoScript=$( echo $SCRIPT_PATH/git-submodule-checkout.sh ) + + +if [ -z "$BUILD_ID" ]; then + BUILD_ID=$(fn-build-id "$BUILD_TYPE" ) +fi + + +fn-submodule-checkout "$BUILD_ID" "$aggDir" "$repoScript" "$repositories" |
