X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=phase1%2Fmaster.cfg;h=1e8e54e0ac4a5041ff9de1083c4c462e5a757db5;hb=c0aabccc93cfbb27238286a36271893333b99443;hp=099f66653436b3fde4ed3178b5bfba4a344f8046;hpb=30cb316a916a8e5c9e995fac4333416a05b7c279;p=buildbot.git diff --git a/phase1/master.cfg b/phase1/master.cfg index 099f666..1e8e54e 100644 --- a/phase1/master.cfg +++ b/phase1/master.cfg @@ -25,6 +25,11 @@ c = BuildmasterConfig = {} # slave name and password must be configured on the slave. from buildbot.buildslave import BuildSlave +slave_port = 9989 + +if ini.has_option("general", "port"): + slave_port = ini.getint("general", "port") + c['slaves'] = [] for section in ini.sections(): @@ -40,7 +45,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'] = 9989 +c['slavePortnum'] = slave_port # coalesce builds c['mergeRequests'] = True @@ -82,6 +87,9 @@ if ini.has_option("gpg", "passfile"): # find targets targets = [ ] +if not os.path.isdir(home_dir+'/source.git'): + subprocess.call(["git", "clone", "--depth=1", repo_url, home_dir+'/source.git']) + findtargets = subprocess.Popen([home_dir+'/dumpinfo.pl', 'targets'], stdout = subprocess.PIPE, cwd = home_dir+'/source.git') @@ -138,67 +146,23 @@ from buildbot.steps.master import MasterShellCommand from buildbot.process.properties import WithProperties -MakeTargetMap = { - "^tools/": "tools/clean", - "^toolchain/": "toolchain/clean", - "^target/linux/": "target/linux/clean", - "^(config|include)/": "dirclean" -} +CleanTargetMap = [ + [ "tools", "tools/clean" ], + [ "chain", "toolchain/clean" ], + [ "linux", "target/linux/clean" ], + [ "dir", "dirclean" ], + [ "dist", "distclean" ] +] -def IsAffected(pattern): - def CheckAffected(change): - for request in change.build.requests: - for source in request.sources: - for change in source.changes: - for file in change.files: - if re.match(pattern, file): - return True - return False - return CheckAffected - -def isPathBuiltin(path): - incl = {} - pkgs = {} - conf = open(".config", "r") - - while True: - line = conf.readline() - if line == '': - break - m = re.match("^(CONFIG_PACKAGE_.+?)=y", line) - if m: - incl[m.group(1)] = True - - conf.close() - - deps = open("tmp/.packagedeps", "r") - - while True: - line = deps.readline() - if line == '': - break - m = re.match("^package-\$\((CONFIG_PACKAGE_.+?)\) \+= (\S+)", line) - if m and incl.get(m.group(1)) == True: - pkgs["package/%s" % m.group(2)] = True - - deps.close() - - while path != '': - if pkgs.get(path) == True: +def IsCleanRequested(pattern): + def CheckCleanProperty(step): + val = step.getProperty("clean") + if val and re.match(pattern, val): return True - path = os.path.dirname(path) + else: + return False - return False - -def isChangeBuiltin(change): - return True -# for request in change.build.requests: -# for source in request.sources: -# for change in source.changes: -# for file in change.files: -# if isPathBuiltin(file): -# return True -# return False + return CheckCleanProperty c['builders'] = [] @@ -290,6 +254,15 @@ for target in targets: haltOnFailure = True, timeout = 2400)) + # user-requested clean targets + for tuple in CleanTargetMap: + factory.addStep(ShellCommand( + name = tuple[1], + description = 'User-requested "make %s"' % tuple[1], + command = ["make", tuple[1], "V=s"], + doStepIf = IsCleanRequested(tuple[0]) + )) + # check out the source factory.addStep(Git(repourl=repo_url, mode='update')) @@ -387,6 +360,14 @@ EOT''' %(ts[0], ts[0], ts[1]) )) want_stdout = False )) + # prepare tar + factory.addStep(ShellCommand( + name = "dltar", + description = "Building GNU tar", + command = ["make", WithProperties("-j%(nproc:~4)s"), "tools/tar/install", "V=s"], + haltOnFailure = True + )) + # populate dl factory.addStep(ShellCommand( name = "dlrun", @@ -402,14 +383,6 @@ EOT''' %(ts[0], ts[0], ts[1]) )) command=["make", "package/base-files/clean", "V=s"] )) - # optional clean steps - for pattern, maketarget in MakeTargetMap.items(): - factory.addStep(ShellCommand( - name = maketarget, - description = maketarget, - command=["make", maketarget, "V=s"], doStepIf=IsAffected(pattern) - )) - # build factory.addStep(ShellCommand( name = "tools", @@ -446,7 +419,6 @@ EOT''' %(ts[0], ts[0], ts[1]) )) name = "pkginstall", description = "Installing packages", command=["make", WithProperties("-j%(nproc:~4)s"), "package/install", "V=s"], - doStepIf = isChangeBuiltin, haltOnFailure = True )) @@ -461,8 +433,7 @@ EOT''' %(ts[0], ts[0], ts[1]) )) factory.addStep(ShellCommand( name = "images", description = "Building images", - command=["make", "-j1", "target/install", "V=s"], - doStepIf = isChangeBuiltin, + command=["make", WithProperties("-j%(nproc:~4)s"), "target/install", "V=s"], haltOnFailure = True )) @@ -470,7 +441,6 @@ EOT''' %(ts[0], ts[0], ts[1]) )) name = "checksums", description = "Calculating checksums", command=["make", "-j1", "checksum", "V=s"], - doStepIf = isChangeBuiltin, haltOnFailure = True )) @@ -529,7 +499,7 @@ EOT''' %(ts[0], ts[0], ts[1]) )) factory.addStep(ShellCommand( name = "targetupload", description = "Uploading target files", - command=["rsync", "--delete", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]), "-avz", WithProperties("bin/targets/%s/%s%%(libc)s/" %(ts[0], ts[1])), "%s/targets/%s/%s/" %(rsync_bin_url, ts[0], ts[1])], + command=["rsync", "--delete", "--checksum", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]), "-avz", WithProperties("bin/targets/%s/%s%%(libc)s/" %(ts[0], ts[1])), "%s/targets/%s/%s/" %(rsync_bin_url, ts[0], ts[1])], env={'RSYNC_PASSWORD': rsync_bin_key}, haltOnFailure = True, logEnviron = False @@ -539,7 +509,7 @@ EOT''' %(ts[0], ts[0], ts[1]) )) factory.addStep(ShellCommand( name = "sourceupload", description = "Uploading source archives", - command=["rsync", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]), "-avz", "dl/", "%s/" %(rsync_src_url)], + command=["rsync", "--checksum", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]), "-avz", "dl/", "%s/" %(rsync_src_url)], env={'RSYNC_PASSWORD': rsync_src_key}, haltOnFailure = True, logEnviron = False