c['slaves'] = []
max_builds = dict()
do_cleanup = dict()
+NetLocks = dict()
for section in ini.sections():
if section.startswith("slave "):
if ini.has_option(section, "name") and ini.has_option(section, "password"):
+ sl_props = { 'dl_lock':None, 'ul_lock':None, }
name = ini.get(section, "name")
password = ini.get(section, "password")
max_builds[name] = 1
max_builds[name] = ini.getint(section, "builds")
if ini.has_option(section, "cleanup"):
do_cleanup[name] = ini.getboolean(section, "cleanup")
- c['slaves'].append(BuildSlave(name, password, max_builds = max_builds[name]))
+ if ini.has_option(section, "dl_lock"):
+ lockname = ini.get(section, "dl_lock")
+ sl_props['dl_lock'] = lockname
+ if lockname not in NetLocks:
+ NetLocks[lockname] = locks.MasterLock(lockname)
+ if ini.has_option(section, "ul_lock"):
+ lockname = ini.get(section, "dl_lock")
+ sl_props['ul_lock'] = lockname
+ if lockname not in NetLocks:
+ NetLocks[lockname] = locks.MasterLock(lockname)
+ c['slaves'].append(BuildSlave(name, password, max_builds = max_builds[name], properties = sl_props))
# 'slavePortnum' defines the TCP port to listen on for connections from slaves.
# This must match the value configured into the buildslaves (with their
from buildbot.steps.transfer import FileDownload
from buildbot.steps.master import MasterShellCommand
from buildbot.process.properties import WithProperties
+from buildbot.process import properties
CleanTargetMap = [
env.update(overrides)
return env
+@properties.renderer
+def NetLockDl(props):
+ lock = None
+ if props.hasProperty("dl_lock"):
+ lock = NetLocks[props["dl_lock"]]
+ if lock is not None:
+ return [lock.access('exclusive')]
+ else:
+ return []
+
+@properties.renderer
+def NetLockUl(props):
+ lock = None
+ if props.hasProperty("ul_lock"):
+ lock = NetLocks[props["ul_lock"]]
+ if lock is not None:
+ return [lock.access('exclusive')]
+ else:
+ return []
c['builders'] = []
description = "Checking out Git branch",
command = "if [ -d .git ]; then git fetch && git checkout '%s'; else exit 0; fi" % repo_branch,
haltOnFailure = True,
- doStepIf = IsNoTaggingRequested
+ doStepIf = IsNoTaggingRequested,
+ locks = NetLockDl,
))
# check out the source
repourl = repo_url,
branch = repo_branch,
mode = 'incremental',
- method = 'clean'))
+ method = 'clean',
+ locks = NetLockDl,
+ ))
# update remote refs
factory.addStep(ShellCommand(
description = "Fetching Git tags",
command = ["git", "fetch", "--tags", "--", repo_url],
haltOnFailure = True,
- doStepIf = IsTaggingRequested
+ doStepIf = IsTaggingRequested,
+ locks = NetLockDl,
))
# switch to tag
name = "updatefeeds",
description = "Updating feeds",
command=["./scripts/feeds", "update"],
- env = MakeEnv()))
+ env = MakeEnv(),
+ locks = NetLockDl,
+ ))
# feed
factory.addStep(ShellCommand(
command = ["make", WithProperties("-j%(jobs)d", jobs=GetNumJobs), "download", "V=s"],
env = MakeEnv(),
logEnviron = False,
- locks = [dlLock.access('exclusive')]
+ locks = properties.FlattenList(NetLockDl, [dlLock.access('exclusive')]),
))
factory.addStep(ShellCommand(
command = ["rsync", "-4", "-avz", "tmp/upload/", "%s/" %(rsync_bin_url)],
env={'RSYNC_PASSWORD': rsync_bin_key},
haltOnFailure = True,
- logEnviron = False
+ logEnviron = False,
+ locks = NetLockUl,
))
factory.addStep(ShellCommand(
WithProperties("%s/%%(prefix)stargets/%s/%s/" %(rsync_bin_url, ts[0], ts[1]), prefix=GetVersionPrefix)],
env={'RSYNC_PASSWORD': rsync_bin_key},
haltOnFailure = True,
- logEnviron = False
+ logEnviron = False,
+ locks = NetLockUl,
))
if enable_kmod_archive:
WithProperties("%s/%%(prefix)stargets/%s/%s/kmods/%%(kernelversion)s/" %(rsync_bin_url, ts[0], ts[1]), prefix=GetVersionPrefix)],
env={'RSYNC_PASSWORD': rsync_bin_key},
haltOnFailure = True,
- logEnviron = False
+ logEnviron = False,
+ locks = NetLockUl,
))
if rsync_src_url is not None:
WithProperties("--partial-dir=.~tmp~%s~%s~%%(slavename)s" %(ts[0], ts[1])), "-avz", "dl/", "%s/" %(rsync_src_url)],
env={'RSYNC_PASSWORD': rsync_src_key},
haltOnFailure = True,
- logEnviron = False
+ logEnviron = False,
+ locks = NetLockUl,
))
if False:
command=["rsync", "-4", "--delete", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]), "-avz", "bin/packages/", "%s/packages/" %(rsync_bin_url)],
env={'RSYNC_PASSWORD': rsync_bin_key},
haltOnFailure = False,
- logEnviron = False
+ logEnviron = False,
+ locks = NetLockUl,
))
# logs
env={'RSYNC_PASSWORD': rsync_bin_key},
haltOnFailure = False,
alwaysRun = True,
- logEnviron = False
+ logEnviron = False,
+ locks = NetLockUl,
))
factory.addStep(ShellCommand(