phase2: honour branch references in feeds.conf
[buildbot.git] / phase2 / master.cfg
index f460ded4d423d3ac37d8887e774e6aa9a7a363ee..ad84ab202fd185688a898c874fa959a31119f896 100644 (file)
@@ -11,6 +11,8 @@ from buildbot import locks
 ini = ConfigParser.ConfigParser()
 ini.read("./config.ini")
 
+buildbot_url = ini.get("general", "buildbot_url")
+
 # This is a sample buildmaster config file. It must be installed as
 # 'master.cfg' in your buildmaster's base directory.
 
@@ -25,6 +27,11 @@ c = BuildmasterConfig = {}
 # slave name and password must be configured on the slave.
 from buildbot.buildslave import BuildSlave
 
+slave_port = 9990
+
+if ini.has_option("general", "port"):
+       slave_port = ini.getint("general", "port")
+
 c['slaves'] = []
 
 for section in ini.sections():
@@ -40,7 +47,7 @@ for section in ini.sections():
 # 'slavePortnum' defines the TCP port to listen on for connections from slaves.
 # This must match the value configured into the buildslaves (with their
 # --master option)
-c['slavePortnum'] = 9990
+c['slavePortnum'] = slave_port
 
 # coalesce builds
 c['mergeRequests'] = True
@@ -49,8 +56,6 @@ c['mergeRequests'] = True
 
 home_dir = os.path.abspath(ini.get("general", "homedir"))
 
-repo_url = ini.get("repo", "url")
-
 rsync_bin_url = ini.get("rsync", "binary_url")
 rsync_bin_key = ini.get("rsync", "binary_password")
 
@@ -61,6 +66,19 @@ if ini.has_option("rsync", "source_url"):
        rsync_src_url = ini.get("rsync", "source_url")
        rsync_src_key = ini.get("rsync", "source_password")
 
+rsync_sdk_url = None
+rsync_sdk_key = None
+rsync_sdk_pat = "lede-sdk-*.tar.xz"
+
+if ini.has_option("rsync", "sdk_url"):
+       rsync_sdk_url = ini.get("rsync", "sdk_url")
+
+if ini.has_option("rsync", "sdk_password"):
+       rsync_sdk_key = ini.get("rsync", "sdk_password")
+
+if ini.has_option("rsync", "sdk_pattern"):
+       rsync_sdk_pat = ini.get("rsync", "sdk_pattern")
+
 gpg_keyid = None
 gpg_comment = "Unattended build signature"
 gpg_passfile = "/dev/null"
@@ -102,7 +120,9 @@ with open(home_dir+'/source.git/feeds.conf.default', 'r') as f:
                parts = line.strip().split()
                if parts[0] == "src-git":
                        feeds.append(parts)
-                       c['change_source'].append(GitPoller(parts[2], workdir='%s/%s.git' %(os.getcwd(), parts[1]), branch='master', pollinterval=300))
+                       url = parts[2].strip().split(';')
+                       branch = url[1] if len(url) > 1 else 'master'
+                       c['change_source'].append(GitPoller(url[0], branch=branch, workdir='%s/%s.git' %(os.getcwd(), parts[1]), branch='master', pollinterval=300))
 
 
 ####### SCHEDULERS
@@ -166,14 +186,14 @@ for arch in arches:
        factory.addStep(ShellCommand(
                name = "cleanold",
                description = "Cleaning previous builds",
-               command = ["./cleanup.sh", WithProperties("%(slavename)s"), WithProperties("%(buildername)s"), "full"],
+               command = ["./cleanup.sh", buildbot_url, WithProperties("%(slavename)s"), WithProperties("%(buildername)s"), "full"],
                haltOnFailure = True,
                timeout = 2400))
 
        factory.addStep(ShellCommand(
                name = "cleanup",
                description = "Cleaning work area",
-               command = ["./cleanup.sh", WithProperties("%(slavename)s"), WithProperties("%(buildername)s"), "single"],
+               command = ["./cleanup.sh", buildbot_url, WithProperties("%(slavename)s"), WithProperties("%(buildername)s"), "single"],
                haltOnFailure = True,
                timeout = 2400))
 
@@ -186,13 +206,15 @@ for arch in arches:
        factory.addStep(ShellCommand(
                name = "downloadsdk",
                description = "Downloading SDK archive",
-               command = ["rsync", "-va", "downloads.lede-project.org::downloads/snapshots/targets/%s/%s/lede-sdk-*.tar.xz" %(ts[0], ts[1]), "sdk.tar.xz"],
-               haltOnFailure = True))
+               command = ["rsync", "-va", "%s/%s/%s/%s" %(rsync_sdk_url, ts[0], ts[1], rsync_sdk_pat), "sdk.archive"],
+               env={'RSYNC_PASSWORD': rsync_sdk_key},
+               haltOnFailure = True,
+               logEnviron = False))
 
        factory.addStep(ShellCommand(
                name = "unpacksdk",
                description = "Unpacking SDK archive",
-               command = ["tar", "--strip-components=1", "-C", "sdk/", "-vxJf", "sdk.tar.xz"],
+               command = ["tar", "--strip-components=1", "-C", "sdk/", "-vxf", "sdk.archive"],
                haltOnFailure = True))
 
        factory.addStep(FileDownload(mastersrc=home_dir+'/key-build', slavedest="sdk/key-build", mode=0600))
@@ -201,7 +223,7 @@ for arch in arches:
        factory.addStep(ShellCommand(
                name = "mkdldir",
                description = "Preparing download directory",
-               command = ["sh", "-c", "mkdir -p $HOME/dl && rmdir ./sdk/dl && ln -sf $HOME/dl ./sdk/dl"]))
+               command = ["sh", "-c", "mkdir -p $HOME/dl && rm -rf ./sdk/dl && ln -sf $HOME/dl ./sdk/dl"]))
 
        factory.addStep(ShellCommand(
                name = "mkconf",
@@ -386,7 +408,7 @@ c['titleURL'] = ini.get("general", "title_url")
 # with an externally-visible host name which the buildbot cannot figure out
 # without some help.
 
-c['buildbotURL'] = ini.get("general", "buildbot_url")
+c['buildbotURL'] = buildbot_url
 
 ####### DB URL