From 4549760f2c8b4af7cb791233d0b4ed03bb9adc36 Mon Sep 17 00:00:00 2001 From: heliclei Date: Fri, 3 Jan 2014 10:59:37 +0800 Subject: [PATCH] fetch pull request and checkout to a local branch --- tools/jenkins-scripts/ghprb.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tools/jenkins-scripts/ghprb.py b/tools/jenkins-scripts/ghprb.py index e17413e505..936ce61bfc 100755 --- a/tools/jenkins-scripts/ghprb.py +++ b/tools/jenkins-scripts/ghprb.py @@ -64,6 +64,21 @@ def main(): except: traceback.format_exc() + #reset path to workspace root + os.system("cd " + os.environ['WORKSPACE']); + + #fetch pull request to local repo + git_fetch_pr = "git fetch origin pull/" + str(pr_num) + "/head" + os.system(git_fetch_pr) + + #checkout + git_checkout = "git checkout -b " + "pull" + str(pr_num) + " FETCH_HEAD" + os.system(git_checkout) + + #update submodule + git_update_submodule = "git submodule update --init --force" + os.system(git_update_submodule) + #build #TODO: support android-mac build currently #TODO: add android-windows7 build