diff options
author | Vishal Bhoj <vishal.bhoj@linaro.org> | 2015-03-19 12:08:58 +0530 |
---|---|---|
committer | Vishal Bhoj <vishal.bhoj@linaro.org> | 2015-03-25 18:23:47 +0530 |
commit | a91d1ef3a6500b1c0da54898313d860392bb0337 (patch) | |
tree | 6ff575d25b8609df00a8606230bbb6ac2f25b370 | |
parent | 031db543c94fe9b30d2afee5cc85827294525827 (diff) |
Change-Id: I1707eda179aadde44db598cde6582701fdd6eeb3
Signed-off-by: Vishal Bhoj <vishal.bhoj@linaro.org>
-rw-r--r-- | build-scripts/build-android | 12 | ||||
-rwxr-xr-x | node/build | 34 |
2 files changed, 43 insertions, 3 deletions
diff --git a/build-scripts/build-android b/build-scripts/build-android index d2950db..b6ba5b7 100644 --- a/build-scripts/build-android +++ b/build-scripts/build-android @@ -67,6 +67,18 @@ else repo-sync-from-mirror "${1}" fi + if [ -n "$GERRIT_PROJECT" ] && [ $GERRIT_EVENT_TYPE -eq "patchset-created" ]; then + if [ "$GERRIT_PROJECT" == "platform/manifest" ]; then + cd .repo/local_manifests; + git pull http://review.android.git.linaro.org/platform/manifest $GERRIT_REFSPEC + cd - + else + cd `grep -rni $GERRIT_PROJECT\" .repo/local_manifests | grep -Po 'path="\K[^"]*'` + git pull http://review.android.git.linaro.org/$GERRIT_PROJECT $GERRIT_REFSPEC + cd - + fi + fi + if [ -n "$PATCHSETS" ]; then for i in $PATCHSETS; do sh ./android-patchsets/$i @@ -23,6 +23,19 @@ cat /etc/issue set -xe +# We need to map which build config to trigger based on the change. +function map_build_config() { + case $GERRIT_PROJECT in + "platform/manifest") echo "armv8-android-juno-lsk";; + "android/device/linaro/juno") echo "armv8-android-juno-lsk";; + "device/linaro/common") echo "armv8-android-juno-lsk";; + "device/linaro/juno32") echo "armv8-android-juno32-lsk";; + "device/linaro/vexpress") echo "vexpress-lcr";; + "device/linaro/fvp-armv8") echo "armv8-android-fvp-lsk";; + "android-patchsets") echo "armv8-android-juno-lsk";; + esac +} + # We need ramdisk size when executing under root, but still don't want # to evaluate build config (== arbitrary code) as such. function get_ramdisk_size () { @@ -54,14 +67,29 @@ source $(get_build_config)/build-tools/build-config if [ -n "$BUILD_CONFIG_REPO" ]; then echo "Fetching build config indirectly from git" + save_dir=$PWD + rm -rf /tmp/buildconf.$$ + mkdir -p /tmp/buildconf.$$ + cd /tmp/buildconf.$$ + git clone "$BUILD_CONFIG_REPO" + cd * + git checkout "$BUILD_CONFIG_BRANCH" + $BUILD_SCRIPT_ROOT/../node/prepare_build_config.py "$(cat "$BUILD_CONFIG_FILENAME")" + cd $save_dir + source $(get_build_config)/build-tools/build-config +fi + +if [ -n "$GERRIT_PROJECT" ] && [ $GERRIT_EVENT_TYPE == "patchset-created" ] ; then + echo "Fetching build config indirectly from git for gerrit trigger" save_dir=$PWD rm -rf /tmp/buildconf.$$ mkdir -p /tmp/buildconf.$$ cd /tmp/buildconf.$$ - git clone "$BUILD_CONFIG_REPO" + git clone https://git.linaro.org/people/vishal.bhoj/android-build-configs.git cd * - git checkout "$BUILD_CONFIG_BRANCH" - $BUILD_SCRIPT_ROOT/../node/prepare_build_config.py "$(cat "$BUILD_CONFIG_FILENAME")" + git checkout master + build_config=$(map_build_config) + $BUILD_SCRIPT_ROOT/../node/prepare_build_config.py "$(cat $build_config)" cd $save_dir source $(get_build_config)/build-tools/build-config fi |