diff options
| author | Paul Webster | 2012-11-16 20:40:25 +0000 |
|---|---|---|
| committer | Paul Webster | 2012-11-16 20:40:25 +0000 |
| commit | ce52b30997e7bc1e7187cec85078c4e6f456ecab (patch) | |
| tree | 676f10d9f2d13dfd385ebada9f7445292e076add | |
| parent | 7689c85b076c3592dd982022344b93e1c63650e3 (diff) | |
| download | eclipse.platform.releng.aggregator-ce52b30997e7bc1e7187cec85078c4e6f456ecab.tar.gz eclipse.platform.releng.aggregator-ce52b30997e7bc1e7187cec85078c4e6f456ecab.tar.xz eclipse.platform.releng.aggregator-ce52b30997e7bc1e7187cec85078c4e6f456ecab.zip | |
Bug 394292 - [CBI] run the pom updater
pom-version-updater.sh will add and commit pom changes in the
submodules, and then add any poms and submodule commits in the
aggregator
| -rw-r--r-- | scripts/build-functions.sh | 60 | ||||
| -rw-r--r-- | scripts/git-submodule-checkout.sh | 2 | ||||
| -rw-r--r-- | scripts/master-build.sh | 47 | ||||
| -rw-r--r-- | scripts/pom-version-updater.sh | 41 |
4 files changed, 146 insertions, 4 deletions
diff --git a/scripts/build-functions.sh b/scripts/build-functions.sh index 8039e8f8e..27693962c 100644 --- a/scripts/build-functions.sh +++ b/scripts/build-functions.sh @@ -235,6 +235,22 @@ fn-submodule-checkout () { echo Some modules have conflicts: $conflict return fi + popd + adds=$( git submodule | grep "^+" | cut -f2 -d" " ) + if [ -z "$adds" ]; then + echo No updates for the submodules + return + fi +} + +# USAGE: fn-add-submodule-updates BUILD_ID REPO_DIR +# 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-add-submodule-updates () { + BUILD_ID="$1"; shift + REPO_DIR="$1"; shift + pushd "$REPO_DIR" adds=$( git submodule | grep "^+" | cut -f2 -d" " ) if [ -z "$adds" ]; then echo No updates for the submodules @@ -242,12 +258,9 @@ fn-submodule-checkout () { 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 @@ -262,3 +275,44 @@ fn-tag-build-inputs () { git push origin $BUILD_ID popd } + + +# USAGE: fn-pom-version-updater BUILD_ID REPO_DIR LOCAL_REPO +# BUILD_ID: I20121116-0700 +# REPO_DIR: /shared/eclipse/builds/R4_2_maintenance/gitCache/eclipse.platform.releng.aggregator +# LOCAL_REPO: /shared/eclipse/builds/R4_2_maintenance/localMavenRepo +# VERBOSE: true +# SIGNING: true +fn-pom-version-updater () { + BUILD_ID="$1"; shift + REPO_DIR="$1"; shift + LOCAL_REPO="$1"; shift + report=/tmp/pom_${BUILD_ID}.txt + MARGS="-DbuildId=$BUILD_ID" + pushd "$REPO_DIR" + mvn $MARGS \ + org.eclipse.tycho:tycho-versions-plugin:update-pom \ + -Dmaven.repo.local=$LOCAL_REPO + changes=$( git status --short -uno | cut -c4- ) + if [ -z "$changes" ]; then + echo No changes in pom versions + return + fi + repos=$( git status --short -uno | cut -c4- | grep -v pom.xml ) + for CURRENT_REPO in $repos; do + pushd "$CURRENT_REPO" + pom_only=$( git status --short -uno | grep -v pom.xml | wc -l ) + if (( pom_only == 0 )); then + git add $( git status --short -uno | cut -c4- ) + git commit -m "Update pom versions for build $BUILD_ID" + echo git push origin HEAD + else + echo Unable to update poms for $CURRENT_REPO + fi + popd + done + echo git add $changes + git add $changes + popd +} + diff --git a/scripts/git-submodule-checkout.sh b/scripts/git-submodule-checkout.sh index a48572c1d..3a31189de 100644 --- a/scripts/git-submodule-checkout.sh +++ b/scripts/git-submodule-checkout.sh @@ -12,7 +12,7 @@ fi git fetch -if [ -z "$(git tag -l $VAL)"]; then +if [ -z "$(git tag -l $VAL)" ]; then echo Updating branch $VAL git checkout $VAL git pull diff --git a/scripts/master-build.sh b/scripts/master-build.sh new file mode 100644 index 000000000..b19ae0388 --- /dev/null +++ b/scripts/master-build.sh @@ -0,0 +1,47 @@ +#!/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" ) +localRepo=$gitCache/localMavenRepo + + +if [ -z "$BUILD_ID" ]; then + BUILD_ID=$(fn-build-id "$BUILD_TYPE" ) +fi + +/bin/bash $SCRIPT_PATH/get-aggregator.sh "$1" +/bin/bash $SCRIPT_PATH/update-build-input.sh "$1" +/bin/bash $SCRIPT_PATH/pom-version-updater.sh "$1" + +pushd "$aggDir" +git commit -m "Build input for build $BUILD_ID" +echo git push origin HEAD +popd + +#/bin/bash $SCRIPT_PATH/tag-build-input.sh "$1" +#/bin/bash $SCRIPT_PATH/run-maven-build.sh "$1" + diff --git a/scripts/pom-version-updater.sh b/scripts/pom-version-updater.sh new file mode 100644 index 000000000..519809cb5 --- /dev/null +++ b/scripts/pom-version-updater.sh @@ -0,0 +1,41 @@ +#!/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" ) +localRepo=$gitCache/localMavenRepo + + +if [ -z "$BUILD_ID" ]; then + BUILD_ID=$(fn-build-id "$BUILD_TYPE" ) +fi + +export JAVA_HOME="$JAVA_HOME" +export MAVEN_OPTS="$MAVEN_OPTS" +export PATH=${JAVA_HOME}/bin:${MAVEN_PATH}:$PATH + + +fn-pom-version-updater "$BUILD_ID" "$aggDir" "$localRepo" |
