aboutsummaryrefslogtreecommitdiff
path: root/node/build
diff options
context:
space:
mode:
Diffstat (limited to 'node/build')
-rwxr-xr-xnode/build28
1 files changed, 28 insertions, 0 deletions
diff --git a/node/build b/node/build
index 4026433..aa61da6 100755
--- a/node/build
+++ b/node/build
@@ -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