[buildbot] phase1: support specifying repository source branch

LEDE Commits lede-commits at lists.infradead.org
Mon Nov 14 06:21:09 PST 2016


jow pushed a commit to buildbot.git, branch master:
https://git.lede-project.org/dce80571478b96b63a80655b987e61c8da1ad2fb

commit dce80571478b96b63a80655b987e61c8da1ad2fb
Author: Jo-Philipp Wich <jo at mein.io>
AuthorDate: Mon Nov 14 15:20:37 2016 +0100

    phase1: support specifying repository source branch
    
    Signed-off-by: Jo-Philipp Wich <jo at mein.io>
---
 phase1/config.ini.example | 1 +
 phase1/master.cfg         | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/phase1/config.ini.example b/phase1/config.ini.example
index 6c69ef1..c502d13 100644
--- a/phase1/config.ini.example
+++ b/phase1/config.ini.example
@@ -20,6 +20,7 @@ password = example
 
 [repo]
 url = https://git.lede-project.org/source.git
+branch = master
 
 [rsync]
 binary_url = user at example.org::upload-binary
diff --git a/phase1/master.cfg b/phase1/master.cfg
index b9fd34e..750763e 100644
--- a/phase1/master.cfg
+++ b/phase1/master.cfg
@@ -59,6 +59,10 @@ if ini.has_option("general", "expire"):
 	tree_expire = ini.getint("general", "expire")
 
 repo_url = ini.get("repo", "url")
+repo_branch = "master"
+
+if ini.has_option("repo", "branch"):
+	repo_branch = ini.get_option("repo", "branch")
 
 rsync_bin_url = ini.get("rsync", "binary_url")
 rsync_bin_key = ini.get("rsync", "binary_password")
@@ -89,6 +93,7 @@ targets = [ ]
 
 if not os.path.isdir(home_dir+'/source.git'):
 	subprocess.call(["git", "clone", "--depth=1", repo_url, home_dir+'/source.git'])
+	subprocess.call(["git", "checkout", repo_branch], cwd = home_dir+'/source.git')
 
 findtargets = subprocess.Popen([home_dir+'/dumpinfo.pl', 'targets'],
 	stdout = subprocess.PIPE, cwd = home_dir+'/source.git')



More information about the lede-commits mailing list