aboutsummaryrefslogtreecommitdiff
path: root/node/build
diff options
context:
space:
mode:
Diffstat (limited to 'node/build')
-rwxr-xr-xnode/build34
1 files changed, 31 insertions, 3 deletions
diff --git a/node/build b/node/build
index 4026433..b4ddfec 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 () {
@@ -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