From 646742e256bcebfae29a59331adde8ce696edcbb Mon Sep 17 00:00:00 2001 From: Leith Bade Date: Sun, 28 Dec 2014 22:18:03 +1300 Subject: [PATCH] Handle pull requests better --- android/scripts/run-build.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/android/scripts/run-build.sh b/android/scripts/run-build.sh index e98fe99fb..d1b1f89de 100755 --- a/android/scripts/run-build.sh +++ b/android/scripts/run-build.sh @@ -11,14 +11,19 @@ sleep=10 instance_name="android-gl-build-$TRAVIS_REPO_SLUG-$TRAVIS_JOB_NUMBER" echo $ami_name -NAME=$TRAVIS_REPO_SLUG/$TRAVIS_JOB_NUMBER +NAME=$TRAVIS_JOB_ID user_data="#!/bin/bash cd /android git clone git://github.com/mapbox/mapbox-gl-native.git pushd mapbox-gl-native - git checkout `git rev-parse HEAD` + if [[ $TRAVIS_PULL_REQUEST == 'false' ]]; then + git checkout $TRAVIS_COMMIT + else + git fetch origin +refs/pull/$TRAVIS_PULL_REQUEST/merge: + git checkout FETCH_HEAD + fi git submodule update --init --recursive export ANDROID_NDK_PATH=/android/android-ndk-r10c