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-31 08:07:57 +0530 |
commit | ec08105594b675c4ae2a9e8b2025c3c778c169e6 (patch) | |
tree | c78ce95e6913b10d0a1c2b5869994867d9d224dc | |
parent | 031db543c94fe9b30d2afee5cc85827294525827 (diff) |
Switch support to gerrit trigger plugin
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 | 28 |
2 files changed, 40 insertions, 0 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 () { @@ -66,6 +79,21 @@ if [ -n "$BUILD_CONFIG_REPO" ]; then 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 https://git.linaro.org/people/vishal.bhoj/android-build-configs.git + cd * + 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 + # Stopgap measure to cleanup environment on instances reused for different jobs mount | grep -E "^tmpfs on .+workspace/" | awk ' {print $3}' | xargs --no-run-if-empty -n1 umount |