2 # ex: set syntax=python:
9 from buildbot import locks
11 # This is a sample buildmaster config file. It must be installed as
12 # 'master.cfg' in your buildmaster's base directory.
14 ini = ConfigParser.ConfigParser()
15 ini.read("./config.ini")
17 # This is the dictionary that the buildmaster pays attention to. We also use
18 # a shorter alias to save typing.
19 c = BuildmasterConfig = {}
21 ####### PROJECT IDENTITY
23 # the 'title' string will appear at the top of this buildbot
24 # installation's html.WebStatus home page (linked to the
25 # 'titleURL') and is embedded in the title of the waterfall HTML page.
27 c['title'] = ini.get("general", "title")
28 c['titleURL'] = ini.get("general", "title_url")
30 # the 'buildbotURL' string should point to the location where the buildbot's
31 # internal web server (usually the html.WebStatus page) is visible. This
32 # typically uses the port number set in the Waterfall 'status' entry, but
33 # with an externally-visible host name which the buildbot cannot figure out
36 c['buildbotURL'] = ini.get("general", "buildbot_url")
40 # The 'slaves' list defines the set of recognized buildslaves. Each element is
41 # a BuildSlave object, specifying a unique slave name and password. The same
42 # slave name and password must be configured on the slave.
43 from buildbot.buildslave import BuildSlave
47 if ini.has_option("general", "port"):
48 slave_port = ini.getint("general", "port")
55 for section in ini.sections():
56 if section.startswith("slave "):
57 if ini.has_option(section, "name") and ini.has_option(section, "password"):
58 sl_props = { 'dl_lock':None, 'ul_lock':None, }
59 name = ini.get(section, "name")
60 password = ini.get(section, "password")
62 do_cleanup[name] = False
63 if ini.has_option(section, "builds"):
64 max_builds[name] = ini.getint(section, "builds")
65 if ini.has_option(section, "cleanup"):
66 do_cleanup[name] = ini.getboolean(section, "cleanup")
67 if ini.has_option(section, "dl_lock"):
68 lockname = ini.get(section, "dl_lock")
69 sl_props['dl_lock'] = lockname
70 if lockname not in NetLocks:
71 NetLocks[lockname] = locks.MasterLock(lockname)
72 if ini.has_option(section, "ul_lock"):
73 lockname = ini.get(section, "dl_lock")
74 sl_props['ul_lock'] = lockname
75 if lockname not in NetLocks:
76 NetLocks[lockname] = locks.MasterLock(lockname)
77 c['slaves'].append(BuildSlave(name, password, max_builds = max_builds[name], properties = sl_props))
79 # 'slavePortnum' defines the TCP port to listen on for connections from slaves.
80 # This must match the value configured into the buildslaves (with their
82 c['slavePortnum'] = slave_port
85 c['mergeRequests'] = True
87 # Reduce amount of backlog data
88 c['buildHorizon'] = 30
93 home_dir = os.path.abspath(ini.get("general", "homedir"))
101 if ini.has_option("general", "expire"):
102 tree_expire = ini.getint("general", "expire")
104 if ini.has_option("general", "other_builds"):
105 other_builds = ini.getint("general", "other_builds")
107 if ini.has_option("general", "cc_version"):
108 cc_version = ini.get("general", "cc_version").split()
109 if len(cc_version) == 1:
110 cc_version = ["eq", cc_version[0]]
112 repo_url = ini.get("repo", "url")
113 repo_branch = "master"
115 if ini.has_option("repo", "branch"):
116 repo_branch = ini.get("repo", "branch")
118 rsync_bin_url = ini.get("rsync", "binary_url")
119 rsync_bin_key = ini.get("rsync", "binary_password")
124 if ini.has_option("rsync", "source_url"):
125 rsync_src_url = ini.get("rsync", "source_url")
126 rsync_src_key = ini.get("rsync", "source_password")
128 gpg_home = "~/.gnupg"
130 gpg_comment = "Unattended build signature"
131 gpg_passfile = "/dev/null"
133 if ini.has_option("gpg", "home"):
134 gpg_home = ini.get("gpg", "home")
136 if ini.has_option("gpg", "keyid"):
137 gpg_keyid = ini.get("gpg", "keyid")
139 if ini.has_option("gpg", "comment"):
140 gpg_comment = ini.get("gpg", "comment")
142 if ini.has_option("gpg", "passfile"):
143 gpg_passfile = ini.get("gpg", "passfile")
145 enable_kmod_archive = True
151 if not os.path.isdir(home_dir+'/source.git'):
152 subprocess.call(["git", "clone", "--depth=1", "--branch="+repo_branch, repo_url, home_dir+'/source.git'])
154 subprocess.call(["git", "pull"], cwd = home_dir+'/source.git')
156 findtargets = subprocess.Popen([home_dir+'/dumpinfo.pl', 'targets'],
157 stdout = subprocess.PIPE, cwd = home_dir+'/source.git')
160 line = findtargets.stdout.readline()
163 ta = line.strip().split(' ')
164 targets.append(ta[0])
167 # the 'change_source' setting tells the buildmaster how it should find out
168 # about source code changes. Here we point to the buildbot clone of pyflakes.
170 from buildbot.changes.gitpoller import GitPoller
171 c['change_source'] = []
172 c['change_source'].append(GitPoller(
174 workdir=home_dir+'/work.git', branch=repo_branch,
179 # Configure the Schedulers, which decide how to react to incoming changes. In this
180 # case, just kick off a 'basebuild' build
182 from buildbot.schedulers.basic import SingleBranchScheduler
183 from buildbot.schedulers.forcesched import ForceScheduler
184 from buildbot.changes import filter
186 c['schedulers'].append(SingleBranchScheduler(
188 change_filter=filter.ChangeFilter(branch=repo_branch),
190 builderNames=targets))
192 c['schedulers'].append(ForceScheduler(
194 builderNames=targets))
198 # The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
199 # what steps, and which slaves can execute them. Note that any particular build will
200 # only take place on one slave.
202 from buildbot.process.factory import BuildFactory
203 from buildbot.steps.source.git import Git
204 from buildbot.steps.shell import ShellCommand
205 from buildbot.steps.shell import SetProperty
206 from buildbot.steps.transfer import FileUpload
207 from buildbot.steps.transfer import FileDownload
208 from buildbot.steps.master import MasterShellCommand
209 from buildbot.process.properties import WithProperties
210 from buildbot.process import properties
214 [ "tools", "tools/clean" ],
215 [ "chain", "toolchain/clean" ],
216 [ "linux", "target/linux/clean" ],
217 [ "dir", "dirclean" ],
218 [ "dist", "distclean" ]
221 def IsMakeCleanRequested(pattern):
222 def CheckCleanProperty(step):
223 val = step.getProperty("clean")
224 if val and re.match(pattern, val):
229 return CheckCleanProperty
231 def IsCleanupRequested(step):
232 val = step.getProperty("slavename")
233 if val and do_cleanup[val]:
238 def IsTaggingRequested(step):
239 val = step.getProperty("tag")
240 if val and re.match("^[0-9]+\.[0-9]+\.[0-9]+(?:-rc[0-9]+)?$", val):
245 def IsNoTaggingRequested(step):
246 return not IsTaggingRequested(step)
248 def IsNoMasterBuild(step):
249 return repo_branch != "master"
251 def IsCleanupConfigured(step):
252 slave = step.getProperty("slavename")
253 if slave and slave in do_cleanup:
254 return do_cleanup[slave] > 0
258 def GetBaseVersion(props):
259 if re.match("^[^-]+-[0-9]+\.[0-9]+$", repo_branch):
260 return repo_branch.split('-')[1]
264 def GetVersionPrefix(props):
265 basever = GetBaseVersion(props)
266 if props.hasProperty("tag") and re.match("^[0-9]+\.[0-9]+\.[0-9]+(?:-rc[0-9]+)?$", props["tag"]):
267 return "%s/" % props["tag"]
268 elif basever != "master":
269 return "%s-SNAPSHOT/" % basever
273 def GetNumJobs(props):
274 if props.hasProperty("slavename") and props.hasProperty("nproc"):
275 return ((int(props["nproc"]) / (max_builds[props["slavename"]] + other_builds)) + 1)
280 if props.hasProperty("cc_command"):
281 return props["cc_command"]
286 if props.hasProperty("cxx_command"):
287 return props["cxx_command"]
292 if props.hasProperty("builddir"):
293 return props["builddir"]
294 elif props.hasProperty("workdir"):
295 return props["workdir"]
299 def GetNextBuild(builder, requests):
301 if r.properties and r.properties.hasProperty("tag"):
305 def MakeEnv(overrides=None):
307 'CC': WithProperties("%(cc)s", cc=GetCC),
308 'CXX': WithProperties("%(cxx)s", cxx=GetCXX),
309 'CCACHE_BASEDIR': WithProperties("%(cwd)s", cwd=GetCwd)
311 if overrides is not None:
312 env.update(overrides)
316 def NetLockDl(props):
318 if props.hasProperty("dl_lock"):
319 lock = NetLocks[props["dl_lock"]]
321 return [lock.access('exclusive')]
326 def NetLockUl(props):
328 if props.hasProperty("ul_lock"):
329 lock = NetLocks[props["ul_lock"]]
331 return [lock.access('exclusive')]
337 dlLock = locks.SlaveLock("slave_dl")
339 checkBuiltin = re.sub('[\t\n ]+', ' ', """
341 local symbol op path file;
342 for file in $CHANGED_FILES; do
348 while read symbol op path; do
349 case "$symbol" in package-*)
350 symbol="${symbol##*(}";
351 symbol="${symbol%)}";
352 for file in $CHANGED_FILES; do
353 case "$file" in "package/$path/"*)
354 grep -qsx "$symbol=y" .config && return 0
358 done < tmp/.packagedeps;
364 class IfBuiltinShellCommand(ShellCommand):
365 def _quote(self, str):
366 if re.search("[^a-zA-Z0-9/_.-]", str):
367 return "'%s'" %(re.sub("'", "'\"'\"'", str))
370 def setCommand(self, command):
371 if not isinstance(command, (str, unicode)):
372 command = ' '.join(map(self._quote, command))
375 '%s; if checkBuiltin; then %s; else exit 0; fi' %(checkBuiltin, command)
378 def setupEnvironment(self, cmd):
379 slaveEnv = self.slaveEnvironment
383 for request in self.build.requests:
384 for source in request.sources:
385 for change in source.changes:
386 for file in change.files:
387 changedFiles[file] = True
388 fullSlaveEnv = slaveEnv.copy()
389 fullSlaveEnv['CHANGED_FILES'] = ' '.join(changedFiles.keys())
390 cmd.args['env'] = fullSlaveEnv
394 for slave in c['slaves']:
395 slaveNames.append(slave.slavename)
397 for target in targets:
398 ts = target.split('/')
400 factory = BuildFactory()
402 # find number of cores
403 factory.addStep(SetProperty(
406 description = "Finding number of CPUs",
407 command = ["nproc"]))
409 # find gcc and g++ compilers
410 if cc_version is not None:
411 factory.addStep(FileDownload(
412 mastersrc = "findbin.pl",
413 slavedest = "../findbin.pl",
416 factory.addStep(SetProperty(
418 property = "cc_command",
419 description = "Finding gcc command",
420 command = ["../findbin.pl", "gcc", cc_version[0], cc_version[1]],
421 haltOnFailure = True))
423 factory.addStep(SetProperty(
425 property = "cxx_command",
426 description = "Finding g++ command",
427 command = ["../findbin.pl", "g++", cc_version[0], cc_version[1]],
428 haltOnFailure = True))
430 # expire tree if needed
432 factory.addStep(FileDownload(
433 mastersrc = "expire.sh",
434 slavedest = "../expire.sh",
437 factory.addStep(ShellCommand(
439 description = "Checking for build tree expiry",
440 command = ["./expire.sh", str(tree_expire)],
442 haltOnFailure = True,
445 # cleanup.sh if needed
446 factory.addStep(FileDownload(
447 mastersrc = "cleanup.sh",
448 slavedest = "../cleanup.sh",
450 doStepIf = IsCleanupRequested))
452 factory.addStep(ShellCommand(
454 description = "Cleaning previous builds",
455 command = ["./cleanup.sh", c['buildbotURL'], WithProperties("%(slavename)s"), WithProperties("%(buildername)s"), "full"],
457 haltOnFailure = True,
458 doStepIf = IsCleanupRequested,
461 factory.addStep(ShellCommand(
463 description = "Cleaning work area",
464 command = ["./cleanup.sh", c['buildbotURL'], WithProperties("%(slavename)s"), WithProperties("%(buildername)s"), "single"],
466 haltOnFailure = True,
467 doStepIf = IsCleanupRequested,
470 # user-requested clean targets
471 for tuple in CleanTargetMap:
472 factory.addStep(ShellCommand(
474 description = 'User-requested "make %s"' % tuple[1],
475 command = ["make", tuple[1], "V=s"],
477 doStepIf = IsMakeCleanRequested(tuple[0])
481 factory.addStep(ShellCommand(
482 name = "switchbranch",
483 description = "Checking out Git branch",
484 command = "if [ -d .git ]; then git fetch && git checkout '%s'; else exit 0; fi" % repo_branch,
485 haltOnFailure = True,
486 doStepIf = IsNoTaggingRequested,
490 # check out the source
493 branch = repo_branch,
494 mode = 'incremental',
500 factory.addStep(ShellCommand(
502 description = "Fetching Git remote refs",
503 command = ["git", "fetch", "origin", "+refs/heads/%s:refs/remotes/origin/%s" %(repo_branch, repo_branch)],
508 factory.addStep(ShellCommand(
510 description = "Fetching Git tags",
511 command = ["git", "fetch", "--tags", "--", repo_url],
512 haltOnFailure = True,
513 doStepIf = IsTaggingRequested,
518 factory.addStep(ShellCommand(
520 description = "Checking out Git tag",
521 command = ["git", "checkout", WithProperties("tags/v%(tag:-)s")],
522 haltOnFailure = True,
523 doStepIf = IsTaggingRequested
526 factory.addStep(ShellCommand(
528 description = "Remove tmp folder",
529 command=["rm", "-rf", "tmp/"]))
532 # factory.addStep(ShellCommand(
533 # name = "feedsconf",
534 # description = "Copy the feeds.conf",
535 # command='''cp ~/feeds.conf ./feeds.conf''' ))
538 factory.addStep(ShellCommand(
539 name = "rmfeedlinks",
540 description = "Remove feed symlinks",
541 command=["rm", "-rf", "package/feeds/"]))
544 factory.addStep(ShellCommand(
545 name = "updatefeeds",
546 description = "Updating feeds",
547 command=["./scripts/feeds", "update"],
553 factory.addStep(ShellCommand(
554 name = "installfeeds",
555 description = "Installing feeds",
556 command=["./scripts/feeds", "install", "-a"],
560 factory.addStep(FileDownload(
561 mastersrc = "config.seed",
562 slavedest = ".config",
567 factory.addStep(ShellCommand(
569 description = "Seeding .config",
570 command = "printf 'CONFIG_TARGET_%s=y\\nCONFIG_TARGET_%s_%s=y\\n' >> .config" %(ts[0], ts[0], ts[1])
573 factory.addStep(ShellCommand(
575 description = "Removing output directory",
576 command = ["rm", "-rf", "bin/"]
579 factory.addStep(ShellCommand(
581 description = "Populating .config",
582 command = ["make", "defconfig"],
587 factory.addStep(ShellCommand(
589 description = "Checking architecture",
590 command = ["grep", "-sq", "CONFIG_TARGET_%s=y" %(ts[0]), ".config"],
598 factory.addStep(SetProperty(
601 description = "Finding libc suffix",
602 command = ["sed", "-ne", '/^CONFIG_LIBC=/ { s!^CONFIG_LIBC="\\(.*\\)"!\\1!; s!^musl$!!; s!.\\+!-&!p }', ".config"]))
605 factory.addStep(FileDownload(
606 mastersrc = "ccache.sh",
607 slavedest = "ccache.sh",
612 factory.addStep(ShellCommand(
614 description = "Preparing ccache",
615 command = ["./ccache.sh"]
619 factory.addStep(FileDownload(mastersrc=home_dir+'/key-build', slavedest="key-build", mode=0600))
620 factory.addStep(FileDownload(mastersrc=home_dir+'/key-build.pub', slavedest="key-build.pub", mode=0600))
623 factory.addStep(ShellCommand(
625 description = "Preparing dl/",
626 command = "mkdir -p $HOME/dl && rm -rf ./dl && ln -sf $HOME/dl ./dl",
632 factory.addStep(ShellCommand(
634 description = "Building GNU tar",
635 command = ["make", WithProperties("-j%(jobs)d", jobs=GetNumJobs), "tools/tar/compile", "V=s"],
641 factory.addStep(ShellCommand(
643 description = "Populating dl/",
644 command = ["make", WithProperties("-j%(jobs)d", jobs=GetNumJobs), "download", "V=s"],
647 locks = properties.FlattenList(NetLockDl, [dlLock.access('exclusive')]),
650 factory.addStep(ShellCommand(
652 description = "Cleaning base-files",
653 command=["make", "package/base-files/clean", "V=s"]
657 factory.addStep(ShellCommand(
659 description = "Building tools",
660 command = ["make", WithProperties("-j%(jobs)d", jobs=GetNumJobs), "tools/install", "V=s"],
665 factory.addStep(ShellCommand(
667 description = "Building toolchain",
668 command=["make", WithProperties("-j%(jobs)d", jobs=GetNumJobs), "toolchain/install", "V=s"],
673 factory.addStep(ShellCommand(
675 description = "Building kmods",
676 command=["make", WithProperties("-j%(jobs)d", jobs=GetNumJobs), "target/compile", "V=s", "IGNORE_ERRORS=n m", "BUILD_LOG=1"],
678 #env={'BUILD_LOG_DIR': 'bin/%s' %(ts[0])},
682 # find kernel version
683 factory.addStep(SetProperty(
684 name = "kernelversion",
685 property = "kernelversion",
686 description = "Finding the effective Kernel version",
687 command = "make --no-print-directory -C target/linux/ val.LINUX_VERSION val.LINUX_RELEASE val.LINUX_VERMAGIC | xargs printf '%s-%s-%s'",
688 env = { 'TOPDIR': WithProperties("%(cwd)s/build", cwd=GetCwd) }
691 factory.addStep(ShellCommand(
693 description = "Cleaning up package build",
694 command=["make", "package/cleanup", "V=s"]
697 factory.addStep(ShellCommand(
699 description = "Building packages",
700 command=["make", WithProperties("-j%(jobs)d", jobs=GetNumJobs), "package/compile", "V=s", "IGNORE_ERRORS=n m", "BUILD_LOG=1"],
702 #env={'BUILD_LOG_DIR': 'bin/%s' %(ts[0])},
706 # factory.addStep(IfBuiltinShellCommand(
707 factory.addStep(ShellCommand(
709 description = "Installing packages",
710 command=["make", WithProperties("-j%(jobs)d", jobs=GetNumJobs), "package/install", "V=s"],
715 factory.addStep(ShellCommand(
717 description = "Indexing packages",
718 command=["make", WithProperties("-j%(jobs)d", jobs=GetNumJobs), "package/index", "V=s"],
723 if enable_kmod_archive:
724 factory.addStep(ShellCommand(
726 description = "Creating kmod directory",
727 command=["mkdir", "-p", WithProperties("bin/targets/%s/%s%%(libc)s/kmods/%%(kernelversion)s" %(ts[0], ts[1]))],
731 factory.addStep(ShellCommand(
732 name = "kmodprepare",
733 description = "Preparing kmod archive",
734 command=["rsync", "--include=/kmod-*.ipk", "--exclude=*", "-va",
735 WithProperties("bin/targets/%s/%s%%(libc)s/packages/" %(ts[0], ts[1])),
736 WithProperties("bin/targets/%s/%s%%(libc)s/kmods/%%(kernelversion)s/" %(ts[0], ts[1]))],
740 factory.addStep(ShellCommand(
742 description = "Indexing kmod archive",
743 command=["make", WithProperties("-j%(jobs)d", jobs=GetNumJobs), "package/index", "V=s",
744 WithProperties("PACKAGE_SUBDIRS=bin/targets/%s/%s%%(libc)s/kmods/%%(kernelversion)s/" %(ts[0], ts[1]))],
749 # find rootfs staging directory
750 factory.addStep(SetProperty(
752 property = "stageroot",
753 description = "Finding the rootfs staging directory",
754 command=["make", "--no-print-directory", "val.STAGING_DIR_ROOT"],
755 env = { 'TOPDIR': WithProperties("%(cwd)s/build", cwd=GetCwd) }
758 factory.addStep(ShellCommand(
760 description = "Creating file overlay directory",
761 command=["mkdir", "-p", "files/etc/opkg"],
765 factory.addStep(ShellCommand(
767 description = "Embedding kmod repository configuration",
768 command=WithProperties("sed -e 's#^\\(src/gz .*\\)_core \\(.*\\)/packages$#&\\n\\1_kmods \\2/kmods/%(kernelversion)s#' " +
769 "%(stageroot)s/etc/opkg/distfeeds.conf > files/etc/opkg/distfeeds.conf"),
773 #factory.addStep(IfBuiltinShellCommand(
774 factory.addStep(ShellCommand(
776 description = "Building images",
777 command=["make", WithProperties("-j%(jobs)d", jobs=GetNumJobs), "target/install", "V=s"],
782 factory.addStep(ShellCommand(
784 description = "Generating config.seed",
785 command=["make", "-j1", "diffconfig", "V=s"],
790 factory.addStep(ShellCommand(
792 description = "Calculating checksums",
793 command=["make", "-j1", "checksum", "V=s"],
799 if gpg_keyid is not None:
800 factory.addStep(MasterShellCommand(
801 name = "signprepare",
802 description = "Preparing temporary signing directory",
803 command = ["mkdir", "-p", "%s/signing" %(home_dir)],
807 factory.addStep(ShellCommand(
809 description = "Packing files to sign",
810 command = WithProperties("find bin/targets/%s/%s%%(libc)s/ bin/targets/%s/%s%%(libc)s/kmods/ -mindepth 1 -maxdepth 2 -type f -name sha256sums -print0 -or -name Packages -print0 | xargs -0 tar -czf sign.tar.gz" %(ts[0], ts[1], ts[0], ts[1])),
814 factory.addStep(FileUpload(
815 slavesrc = "sign.tar.gz",
816 masterdest = "%s/signing/%s.%s.tar.gz" %(home_dir, ts[0], ts[1]),
820 factory.addStep(MasterShellCommand(
822 description = "Signing files",
823 command = ["%s/signall.sh" %(home_dir), "%s/signing/%s.%s.tar.gz" %(home_dir, ts[0], ts[1]), gpg_keyid, gpg_comment],
824 env = {'GNUPGHOME': gpg_home, 'PASSFILE': gpg_passfile},
828 factory.addStep(FileDownload(
829 mastersrc = "%s/signing/%s.%s.tar.gz" %(home_dir, ts[0], ts[1]),
830 slavedest = "sign.tar.gz",
834 factory.addStep(ShellCommand(
836 description = "Unpacking signed files",
837 command = ["tar", "-xzf", "sign.tar.gz"],
842 factory.addStep(ShellCommand(
844 description = "Preparing upload directory structure",
845 command = ["mkdir", "-p", WithProperties("tmp/upload/%%(prefix)stargets/%s/%s" %(ts[0], ts[1]), prefix=GetVersionPrefix)],
849 factory.addStep(ShellCommand(
850 name = "linkprepare",
851 description = "Preparing repository symlink",
852 command = ["ln", "-s", "-f", WithProperties("../packages-%(basever)s", basever=GetBaseVersion), WithProperties("tmp/upload/%(prefix)spackages", prefix=GetVersionPrefix)],
853 doStepIf = IsNoMasterBuild,
857 if enable_kmod_archive:
858 factory.addStep(ShellCommand(
859 name = "kmoddirprepare",
860 description = "Preparing kmod archive upload directory",
861 command = ["mkdir", "-p", WithProperties("tmp/upload/%%(prefix)stargets/%s/%s/kmods/%%(kernelversion)s" %(ts[0], ts[1]), prefix=GetVersionPrefix)],
865 factory.addStep(ShellCommand(
867 description = "Uploading directory structure",
868 command = ["rsync", "-4", "--info=name", "-az", "tmp/upload/", "%s/" %(rsync_bin_url)],
869 env={'RSYNC_PASSWORD': rsync_bin_key},
870 haltOnFailure = True,
875 factory.addStep(FileDownload(
876 mastersrc = "rsync.sh",
877 slavedest = "../rsync.sh",
880 factory.addStep(ShellCommand(
881 name = "targetupload",
882 description = "Uploading target files",
883 command=["../rsync.sh", "-4", "--info=name", "--exclude=/kmods/", "--delete", "--size-only", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]),
884 "-az", WithProperties("bin/targets/%s/%s%%(libc)s/" %(ts[0], ts[1])),
885 WithProperties("%s/%%(prefix)stargets/%s/%s/" %(rsync_bin_url, ts[0], ts[1]), prefix=GetVersionPrefix)],
886 env={'RSYNC_PASSWORD': rsync_bin_key},
887 haltOnFailure = True,
892 if enable_kmod_archive:
893 factory.addStep(ShellCommand(
895 description = "Uploading kmod archive",
896 command=["../rsync.sh", "-4", "--info=name", "--delete", "--size-only", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]),
897 "-az", WithProperties("bin/targets/%s/%s%%(libc)s/kmods/%%(kernelversion)s/" %(ts[0], ts[1])),
898 WithProperties("%s/%%(prefix)stargets/%s/%s/kmods/%%(kernelversion)s/" %(rsync_bin_url, ts[0], ts[1]), prefix=GetVersionPrefix)],
899 env={'RSYNC_PASSWORD': rsync_bin_key},
900 haltOnFailure = True,
905 if rsync_src_url is not None:
906 factory.addStep(ShellCommand(
907 name = "sourceupload",
908 description = "Uploading source archives",
909 command=["../rsync.sh", "-4", "--info=name", "--size-only", "--delay-updates",
910 WithProperties("--partial-dir=.~tmp~%s~%s~%%(slavename)s" %(ts[0], ts[1])), "-az", "dl/", "%s/" %(rsync_src_url)],
911 env={'RSYNC_PASSWORD': rsync_src_key},
912 haltOnFailure = True,
918 factory.addStep(ShellCommand(
919 name = "packageupload",
920 description = "Uploading package files",
921 command=["../rsync.sh", "-4", "--info=name", "--delete", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]), "-az", "bin/packages/", "%s/packages/" %(rsync_bin_url)],
922 env={'RSYNC_PASSWORD': rsync_bin_key},
923 haltOnFailure = False,
930 factory.addStep(ShellCommand(
932 description = "Uploading logs",
933 command=["../rsync.sh", "-4", "-info=name", "--delete", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]), "-az", "logs/", "%s/logs/%s/%s/" %(rsync_bin_url, ts[0], ts[1])],
934 env={'RSYNC_PASSWORD': rsync_bin_key},
935 haltOnFailure = False,
941 factory.addStep(ShellCommand(
943 description = "Reporting disk usage",
944 command=["df", "-h", "."],
946 haltOnFailure = False,
950 from buildbot.config import BuilderConfig
952 c['builders'].append(BuilderConfig(name=target, slavenames=slaveNames, factory=factory, nextBuild=GetNextBuild))
955 ####### STATUS TARGETS
957 # 'status' is a list of Status Targets. The results of each build will be
958 # pushed to these targets. buildbot/status/*.py has a variety to choose from,
959 # including web pages, email senders, and IRC bots.
963 from buildbot.status import html
964 from buildbot.status.web import authz, auth
966 if ini.has_option("status", "bind"):
967 if ini.has_option("status", "user") and ini.has_option("status", "password"):
968 authz_cfg=authz.Authz(
969 # change any of these to True to enable; see the manual for more
971 auth=auth.BasicAuth([(ini.get("status", "user"), ini.get("status", "password"))]),
972 gracefulShutdown = 'auth',
973 forceBuild = 'auth', # use this to test your slave once it is set up
974 forceAllBuilds = 'auth',
977 stopAllBuilds = 'auth',
978 cancelPendingBuild = 'auth',
980 c['status'].append(html.WebStatus(http_port=ini.get("status", "bind"), authz=authz_cfg))
982 c['status'].append(html.WebStatus(http_port=ini.get("status", "bind")))
985 from buildbot.status import words
987 if ini.has_option("irc", "host") and ini.has_option("irc", "nickname") and ini.has_option("irc", "channel"):
988 irc_host = ini.get("irc", "host")
990 irc_chan = ini.get("irc", "channel")
991 irc_nick = ini.get("irc", "nickname")
994 if ini.has_option("irc", "port"):
995 irc_port = ini.getint("irc", "port")
997 if ini.has_option("irc", "password"):
998 irc_pass = ini.get("irc", "password")
1000 irc = words.IRC(irc_host, irc_nick, port = irc_port, password = irc_pass,
1001 channels = [{ "channel": irc_chan }],
1004 'successToFailure': 1,
1005 'failureToSuccess': 1
1009 c['status'].append(irc)
1014 # This specifies what database buildbot uses to store its state. You can leave
1015 # this at its default for all but the largest installations.
1016 'db_url' : "sqlite:///state.sqlite",