Ticket #238: 238.patch

File 238.patch, 32.5 kB (added by dustin, 9 months ago)

#238:from_buildbot_config_import.patch

  • old-docwork/buildbot/scripts/sample.cfg

    old new  
    11# -*- python -*- 
    22# ex: set syntax=python: 
    33 
     4from buildbot.config import * 
     5 
    46# This is a sample buildmaster config file. It must be installed as 
    57# 'master.cfg' in your buildmaster's base directory (although the filename 
    68# can be changed with the --basedir option to 'mktap buildbot master'). 
     
    1921# the 'slaves' list defines the set of allowable buildslaves. Each element is 
    2022# a tuple of bot-name and bot-password. These correspond to values given to 
    2123# the buildslave's mktap invocation. 
    22 from buildbot.buildslave import BuildSlave 
    2324c['slaves'] = [BuildSlave("bot1name", "bot1passwd")] 
    2425 
    2526# to limit to two concurrent builds on a slave, use 
     
    3738# about source code changes. Any class which implements IChangeSource can be 
    3839# put here: there are several in buildbot/changes/*.py to choose from. 
    3940 
    40 from buildbot.changes.pb import PBChangeSource 
    4141c['change_source'] = PBChangeSource() 
    4242 
    4343# For example, if you had CVSToys installed on your repository, and your 
     
    6565 
    6666## configure the Schedulers 
    6767 
    68 from buildbot.scheduler import Scheduler 
    6968c['schedulers'] = [] 
    7069c['schedulers'].append(Scheduler(name="all", branch=None, 
    7170                                 treeStableTimer=2*60, 
     
    9594cvsroot = ":pserver:anonymous@cvs.sourceforge.net:/cvsroot/buildbot" 
    9695cvsmodule = "buildbot" 
    9796 
    98 from buildbot.process import factory 
    99 from buildbot.steps.source import CVS 
    100 from buildbot.steps.shell import Compile 
    101 from buildbot.steps.python_twisted import Trial 
    102 f1 = factory.BuildFactory() 
     97f1 = BuildFactory() 
    10398f1.addStep(CVS(cvsroot=cvsroot, cvsmodule=cvsmodule, login="", mode="copy")) 
    10499f1.addStep(Compile(command=["python", "./setup.py", "build"])) 
    105100f1.addStep(Trial(testpath=".")) 
     
    120115 
    121116c['status'] = [] 
    122117 
    123 from buildbot.status import html 
    124 c['status'].append(html.WebStatus(http_port=8010)) 
     118c['status'].append(WebStatus(http_port=8010)) 
    125119 
    126 # from buildbot.status import mail 
    127 # c['status'].append(mail.MailNotifier(fromaddr="buildbot@localhost", 
    128 #                                      extraRecipients=["builds@example.com"], 
    129 #                                      sendToInterestedUsers=False)) 
     120# c['status'].append(MailNotifier(fromaddr="buildbot@localhost", 
     121#                                 extraRecipients=["builds@example.com"], 
     122#                                 sendToInterestedUsers=False)) 
    130123# 
    131 # from buildbot.status import words 
    132 # c['status'].append(words.IRC(host="irc.example.com", nick="bb", 
    133 #                              channels=["#example"])) 
     124# c['status'].append(IRC(host="irc.example.com", nick="bb", 
     125#                        channels=["#example"])) 
    134126# 
    135 # from buildbot.status import client 
    136 # c['status'].append(client.PBListener(9988)) 
     127# c['status'].append(PBListener(9988)) 
    137128 
    138129 
    139130####### DEBUGGING OPTIONS 
     
    151142# interactive python shell, which may be useful for debugging buildbot 
    152143# internals. It is probably only useful for buildbot developers. You can also 
    153144# use an authorized_keys file, or plain telnet. 
    154 #from buildbot import manhole 
    155 #c['manhole'] = manhole.PasswordManhole("tcp:9999:interface=127.0.0.1", 
    156 #                                       "admin", "password") 
     145#from buildbot.manhole import PasswordManhole 
     146#c['manhole'] = PasswordManhole("tcp:9999:interface=127.0.0.1", 
     147#                               "admin", "password") 
    157148 
    158149 
    159150####### PROJECT IDENTITY 
  • old-docwork/docs/buildbot.texinfo

    old new  
    19601960'key2': 'value2'@} }. Function calls (and object instantiation) can use 
    19611961named parameters, like @code{w = html.Waterfall(http_port=8010)}. 
    19621962 
    1963 The config file starts with a series of @code{import} statements, 
    1964 which make various kinds of Steps and Status targets available for 
    1965 later use. The main @code{BuildmasterConfig} dictionary is created, 
    1966 then it is populated with a variety of keys. These keys are broken 
    1967 roughly into the following sections, each of which is documented in 
    1968 the rest of this chapter: 
    1969  
    1970 @itemize @bullet 
    1971 @item 
    1972 Project Definitions 
    1973 @item 
    1974 Change Sources / Schedulers 
    1975 @item 
    1976 Slaveport 
    1977 @item 
    1978 Buildslave Configuration 
    1979 @item 
    1980 Builders / Interlocks 
    1981 @item 
    1982 Status Targets 
    1983 @item 
    1984 Debug options 
    1985 @end itemize 
     1963The config file usually starts with the following lines: 
     1964@example 
     1965from buildbot.config import * 
     1966BuildmasterConfig = c = @{@} 
     1967@end example 
    19861968 
    1987 The config file can use a few names which are placed into its namespace: 
     1969The first line imports all of the symbols typically used 
     1970in a configuration file.  The next line creates the main 
     1971@code{BuildmasterConfig} variable, containing a dictionary which 
     1972is the output of the configuration.  It also creates the shorter 
     1973name @code{c} for this dictionary. 
    19881974 
    1989 @table @code 
    1990 @item basedir 
    1991 the base directory for the buildmaster. This string has not been 
    1992 expanded, so it may start with a tilde. It needs to be expanded before 
    1993 use. The config file is located in 
    1994 @code{os.path.expanduser(os.path.join(basedir, 'master.cfg'))} 
     1975The remainder of this chapter describes the various keys for this 
     1976dictionary, generally created with code such as 
    19951977 
    1996 @end table 
     1978@example 
     1979c['projectName'] = "Buildbot" 
     1980@end example 
    19971981 
     1982The config file can use a the variable @code{basedir}, which 
     1983is the base directory for the buildmaster. This string has not 
     1984been expanded, so it may start with a tilde. It needs to be 
     1985expanded before use. To generate the pathname of a file named 
     1986@code{info.txt} in the same directory as the configuration file, 
     1987use @code{os.path.expanduser(os.path.join(basedir, 'info.txt'))} 
    19981988 
    19991989@node Loading the Config File, Testing the Config File, Config File Format, Configuration 
    20001990@section Loading the Config File 
     
    21272117Code Changes}. 
    21282118 
    21292119@example 
    2130 from buildbot.changes.pb import PBChangeSource 
    21312120c['change_source'] = PBChangeSource() 
    21322121@end example 
    21332122 
     
    21762165@end table 
    21772166 
    21782167@example 
    2179 from buildbot import scheduler 
    2180 quick = scheduler.Scheduler("quick", None, 60, 
    2181                             ["quick-linux", "quick-netbsd"]) 
    2182 full = scheduler.Scheduler("full", None, 5*60, 
    2183                            ["full-linux", "full-netbsd", "full-OSX"]) 
    2184 nightly = scheduler.Periodic("nightly", ["full-solaris"], 24*60*60) 
     2168quick = Scheduler("quick", None, 60, 
     2169                  ["quick-linux", "quick-netbsd"]) 
     2170full = Scheduler("full", None, 5*60, 
     2171                 ["full-linux", "full-netbsd", "full-OSX"]) 
     2172nightly = Periodic("nightly", ["full-solaris"], 24*60*60) 
    21852173c['schedulers'] = [quick, full, nightly] 
    21862174@end example 
    21872175 
     
    22992287the downstream builds will not fire. 
    23002288 
    23012289@example 
    2302 from buildbot import scheduler 
    2303 tests = scheduler.Scheduler("tests", None, 5*60, 
    2304                             ["full-linux", "full-netbsd", "full-OSX"]) 
    2305 package = scheduler.Dependent("package", 
    2306                               tests, # upstream scheduler 
    2307                               ["make-tarball", "make-deb", "make-rpm"]) 
     2290tests = Scheduler("tests", None, 5*60, 
     2291                  ["full-linux", "full-netbsd", "full-OSX"]) 
     2292package = Dependent("package", 
     2293                    tests, # upstream scheduler 
     2294                    ["make-tarball", "make-deb", "make-rpm"]) 
    23082295c['schedulers'] = [tests, package] 
    23092296@end example 
    23102297 
     
    23232310perform some work for them, perhaps on other buildslaves. 
    23242311 
    23252312@example 
    2326 from buildbot import scheduler 
    2327 from buildbot.steps import trigger 
    2328  
    2329 checkin = scheduler.Scheduler("checkin", None, 5*60, ["checkin"]) 
    2330 nightly = scheduler.Scheduler("nightly", ... , ["nightly"]) 
     2313checkin = Scheduler("checkin", None, 5*60, ["checkin"]) 
     2314nightly = Scheduler("nightly", ... , ["nightly"]) 
    23312315 
    2332 mktarball = scheduler.Triggerable("mktarball", 
    2333                                   ["mktarball"]) 
    2334 build = scheduler.Triggerable("build-all-platforms", 
    2335                               ["build-all-platforms"]) 
    2336 test = scheduler.Triggerable("distributed-test", 
    2337                              ["distributed-test"]) 
    2338 package = scheduler.Triggerable("package-all-platforms", 
    2339                                 ["package-all-platforms"]) 
     2316mktarball = Triggerable("mktarball", 
     2317                        ["mktarball"]) 
     2318build = Triggerable("build-all-platforms", 
     2319                    ["build-all-platforms"]) 
     2320test = Triggerable("distributed-test", 
     2321                   ["distributed-test"]) 
     2322package = Triggerable("package-all-platforms", 
     2323                      ["package-all-platforms"]) 
    23402324 
    23412325c['schedulers'] = [checkin, nightly, build, test, package] 
    23422326 
    2343 checkin_factory = factory.BuildFactory() 
    2344 f.addStep(trigger.Trigger('mktarball', schedulers=['mktarball'], 
    2345                                        waitForFinish=True) 
    2346 f.addStep(trigger.Trigger('build', schedulers=['build-all-platforms'], 
    2347                                    waitForFinish=True) 
    2348 f.addStep(trigger.Trigger('test', schedulers=['distributed-test'], 
    2349                                   waitForFinish=True) 
    2350  
    2351 nightly_factory = factory.BuildFactory() 
    2352 f.addStep(trigger.Trigger('mktarball', schedulers=['mktarball'], 
    2353                                        waitForFinish=True) 
    2354 f.addStep(trigger.Trigger('build', schedulers=['build-all-platforms'], 
    2355                                    waitForFinish=True) 
    2356 f.addStep(trigger.Trigger('package', schedulers=['package-all-platforms'], 
    2357                                      waitForFinish=True) 
     2327checkin_factory = BuildFactory() 
     2328f.addStep(Trigger('mktarball', schedulers=['mktarball'], 
     2329                               waitForFinish=True) 
     2330f.addStep(Trigger('build', schedulers=['build-all-platforms'], 
     2331                           waitForFinish=True) 
     2332f.addStep(Trigger('test', schedulers=['distributed-test'], 
     2333                          waitForFinish=True) 
     2334 
     2335nightly_factory = BuildFactory() 
     2336f.addStep(Trigger('mktarball', schedulers=['mktarball'], 
     2337                               waitForFinish=True) 
     2338f.addStep(Trigger('build', schedulers=['build-all-platforms'], 
     2339                           waitForFinish=True) 
     2340f.addStep(Trigger('package', schedulers=['package-all-platforms'], 
     2341                             waitForFinish=True) 
    23582342@end example 
    23592343 
    23602344@node Setting the slaveport, Buildslave Specifiers, Listing Change Sources and Schedulers, Configuration 
     
    24062390they create the buildslave. 
    24072391 
    24082392@example 
    2409 from buildbot.buildslave import BuildSlave 
    24102393c['slaves'] = [BuildSlave('bot-solaris', 'solarispasswd'), 
    24112394               BuildSlave('bot-bsd', 'bsdpasswd'), 
    24122395              ] 
     
    24262409execute simultaneously: 
    24272410 
    24282411@example 
    2429 from buildbot.buildslave import BuildSlave 
    24302412c['slaves'] = [BuildSlave("bot-linux", "linuxpassword", max_builds=2)] 
    24312413@end example 
    24322414 
     
    24882470builders=[], as follows: 
    24892471 
    24902472@example 
    2491 from buildbot.status import mail 
    2492 m = mail.MailNotifier(fromaddr="buildbot@@localhost", builders=[], 
    2493                       relayhost="smtp.example.org") 
     2473m = MailNotifier(fromaddr="buildbot@@localhost", builders=[], 
     2474                 relayhost="smtp.example.org") 
    24942475c['status'].append(m) 
    24952476c['slaves'] = [BuildSlave('bot-solaris', 'solarispasswd', 
    24962477                          notify_on_missing="bob@@example.com"), 
     
    25912572@example 
    25922573c['status'] = [] 
    25932574 
    2594 from buildbot.status import html 
    2595 c['status'].append(html.Waterfall(http_port=8010)) 
     2575c['status'].append(Waterfall(http_port=8010)) 
    25962576 
    2597 from buildbot.status import mail 
    2598 m = mail.MailNotifier(fromaddr="buildbot@@localhost", 
    2599                       extraRecipients=["builds@@lists.example.com"], 
    2600                       sendToInterestedUsers=False) 
     2577m = MailNotifier(fromaddr="buildbot@@localhost", 
     2578                 extraRecipients=["builds@@lists.example.com"], 
     2579                 sendToInterestedUsers=False) 
    26012580c['status'].append(m) 
    26022581 
    2603 from buildbot.status import words 
    2604 c['status'].append(words.IRC(host="irc.example.com", nick="bb", 
    2605                              channels=["#example"])) 
     2582c['status'].append(IRC(host="irc.example.com", nick="bb", 
     2583                       channels=["#example"])) 
    26062584@end example 
    26072585 
    26082586Status delivery has its own chapter, @xref{Status Delivery}, in which 
     
    26402618one uses unencrypted telnet. Two of them use a username+password 
    26412619combination to grant access, one of them uses an SSH-style 
    26422620@file{authorized_keys} file which contains a list of ssh public keys. 
     2621These modules are for advanced users, so they are not included in 
     2622@code{buildbot.config} and must be imported explicitly. 
    26432623 
    26442624@table @code 
    26452625@item manhole.AuthorizedKeysManhole 
     
    26632643highly recommended that you use one of the SSH manholes instead. 
    26642644 
    26652645@end table 
    2666  
     2646Examples: 
    26672647@example 
    2668 # some examples: 
    2669 from buildbot import manhole 
    2670 c['manhole'] = manhole.AuthorizedKeysManhole(1234, "authorized_keys") 
    2671 c['manhole'] = manhole.PasswordManhole(1234, "alice", "mysecretpassword") 
    2672 c['manhole'] = manhole.TelnetManhole(1234, "bob", "snoop_my_password_please") 
     2648from buildbot.manhole import AuthorizedKeysManhole 
     2649c['manhole'] = AuthorizedKeysManhole(1234, "authorized_keys") 
     2650 
     2651from buildbot.manhole import PasswordManhole 
     2652c['manhole'] = PasswordManhole(1234, "alice", "mysecretpassword") 
     2653 
     2654from buildbot.manhole import TelnetManhole 
     2655c['manhole'] = TelnetManhole(1234, "bob", "snoop_my_password_please") 
    26732656@end example 
    26742657 
    26752658The @code{Manhole} instance can be configured to listen on a specific 
     
    27862769@end itemize 
    27872770 
    27882771As a quick guide, here is a list of VC systems and the ChangeSources 
    2789 that might be useful with them. All of these ChangeSources are in the 
    2790 @code{buildbot.changes} module. 
     2772that might be useful with them. 
    27912773 
    27922774@table @code 
    27932775@item CVS 
    27942776 
    27952777@itemize @bullet 
    2796 @item freshcvs.FreshCVSSource (connected via TCP to the freshcvs daemon
    2797 @item mail.FCMaildirSource (watching for email sent by a freshcvs daemon) 
    2798 @item mail.BonsaiMaildirSource (watching for email sent by Bonsai) 
    2799 @item mail.SyncmailMaildirSource (watching for email sent by syncmail) 
    2800 @item pb.PBChangeSource (listening for connections from @code{buildbot 
     2778@item FreshCVSSource (connected via TCP to the freshcvs daemon; note that this module must be imported explicitly via @code{from buildbot.changes.freshcvs import FreshCVSSource}
     2779@item FCMaildirSource (watching for email sent by a freshcvs daemon) 
     2780@item BonsaiMaildirSource (watching for email sent by Bonsai) 
     2781@item SyncmailMaildirSource (watching for email sent by syncmail) 
     2782@item PBChangeSource (listening for connections from @code{buildbot 
    28012783sendchange} run in a loginfo script) 
    2802 @item pb.PBChangeSource (listening for connections from a long-running 
     2784@item PBChangeSource (listening for connections from a long-running 
    28032785@code{contrib/viewcvspoll.py} polling process which examines the ViewCVS 
    28042786database directly 
    28052787@end itemize 
    28062788 
    28072789@item SVN 
    28082790@itemize @bullet 
    2809 @item pb.PBChangeSource (listening for connections from 
     2791@item PBChangeSource (listening for connections from 
    28102792@code{contrib/svn_buildbot.py} run in a postcommit script) 
    2811 @item pb.PBChangeSource (listening for connections from a long-running 
     2793@item PBChangeSource (listening for connections from a long-running 
    28122794@code{contrib/svn_watcher.py} or @code{contrib/svnpoller.py} polling 
    28132795process 
    2814 @item mail.SVNCommitEmailMaildirSource (watching for email sent by commit-email.pl) 
    2815 @item svnpoller.SVNPoller (polling the SVN repository) 
     2796@item SVNCommitEmailMaildirSource (watching for email sent by commit-email.pl) 
     2797@item SVNPoller (polling the SVN repository) 
    28162798@end itemize 
    28172799 
    28182800@item Darcs 
    28192801@itemize @bullet 
    2820 @item pb.PBChangeSource (listening for connections from 
     2802@item PBChangeSource (listening for connections from 
    28212803@code{contrib/darcs_buildbot.py} in a commit script 
    28222804@end itemize 
    28232805 
    28242806@item Mercurial 
    28252807@itemize @bullet 
    2826 @item pb.PBChangeSource (listening for connections from 
     2808@item PBChangeSource (listening for connections from 
    28272809@code{contrib/hg_buildbot.py} run in an 'incoming' hook) 
    2828 @item pb.PBChangeSource (listening for connections from 
     2810@item PBChangeSource (listening for connections from 
    28292811@code{buildbot/changes/hgbuildbot.py} run as an in-process 'changegroup' 
    28302812hook) 
    28312813@end itemize 
    28322814 
    28332815@item Arch/Bazaar 
    28342816@itemize @bullet 
    2835 @item pb.PBChangeSource (listening for connections from 
     2817@item PBChangeSource (listening for connections from 
    28362818@code{contrib/arch_buildbot.py} run in a commit hook) 
    28372819@end itemize 
    28382820 
    28392821@item Git 
    28402822@itemize @bullet 
    2841 @item pb.PBChangeSource (listening for connections from 
     2823@item PBChangeSource (listening for connections from 
    28422824@code{contrib/git_buildbot.py} run in the post-receive hook) 
    28432825@end itemize 
    28442826 
     
    28622844Each buildmaster typically has just a single ChangeSource, since it is 
    28632845only watching a single source tree. But if, for some reason, you need 
    28642846multiple sources, just set @code{c['change_source']} to a list of 
    2865 ChangeSources.. it will accept that too. 
     2847ChangeSources -- it will accept that too. 
    28662848 
    28672849@example 
     2850from buildbot.changes.freshcvs import FreshCVSSourceNewcred 
    28682851s = FreshCVSSourceNewcred(host="host", port=4519, 
    28692852                          user="alice", passwd="secret", 
    28702853                          prefix="Twisted") 
     
    28942877works by listening on a TCP port for clients. These clients subscribe 
    28952878to hear about commit notifications. 
    28962879 
    2897 The buildmaster has a CVSToys-compatible @code{PBService} client built 
    2898 in. There are two versions of it, one for old versions of CVSToys 
    2899 (1.0.9 and earlier) which used the @code{oldcred} authentication 
    2900 framework, and one for newer versions (1.0.10 and later) which use 
    2901 @code{newcred}. Both are classes in the 
    2902 @code{buildbot.changes.freshcvs} package. 
     2880The buildmaster has a CVSToys-compatible @code{PBService} client 
     2881built in. There are two versions of it, one for old versions 
     2882of CVSToys (1.0.9 and earlier) which used the @code{oldcred} 
     2883authentication framework, and one for newer versions (1.0.10 
     2884and later) which use @code{newcred}. Both are classes in the 
     2885@code{buildbot.changes.freshcvs} package.  Because CVSToys is 
     2886not installed on all systems, these symbols are not included in 
     2887@code{buildbot.config} and must be imported explicitly: 
     2888 
     2889@example 
     2890from buildbot.changes.freshcvs import FreshCVSSourceOldcred 
     2891from buildbot.changes.freshcvs import FreshCVSSourceNewcred 
     2892@end example 
    29032893 
    29042894@code{FreshCVSSourceNewcred} objects are created with the following 
    29052895parameters: 
     
    29402930Then add a clause like this to your buildmaster's @file{master.cfg}: 
    29412931 
    29422932@example 
     2933from buildbot.changes.freshcvs import FreshCVSSource 
    29432934BuildmasterConfig['change_source'] = FreshCVSSource("cvs.example.com", 4519, 
    29442935                                                    "foo", "bar", 
    29452936                                                    prefix="glib/") 
     
    29862977the change source and put it in @code{c['change_source']}: 
    29872978 
    29882979@example 
    2989 from buildbot.changes.mail import SyncmailMaildirSource 
    29902980c['change_source'] = SyncmailMaildirSource("~/maildir-buildbot", 
    29912981                                           prefix="/trunk/") 
    29922982@end example 
     
    31413131strip. 
    31423132 
    31433133@example 
    3144 from buildbot.changes.mail import FCMaildirSource 
    31453134c['change_source'] = FCMaildirSource("~/maildir-buildbot") 
    31463135@end example 
    31473136 
     
    31563145the CVS ``syncmail'' script. 
    31573146 
    31583147@example 
    3159 from buildbot.changes.mail import SyncmailMaildirSource 
    31603148c['change_source'] = SyncmailMaildirSource("~/maildir-buildbot") 
    31613149@end example 
    31623150 
     
    31713159tree-management system built by Mozilla. 
    31723160 
    31733161@example 
    3174 from buildbot.changes.mail import BonsaiMaildirSource 
    31753162c['change_source'] = BonsaiMaildirSource("~/maildir-buildbot") 
    31763163@end example 
    31773164 
     
    31883175it creates will be associated with the default (i.e. trunk) branch. 
    31893176 
    31903177@example 
    3191 from buildbot.changes.mail import SVNCommitEmailMaildirSource 
    31923178c['change_source'] = SVNCommitEmailMaildirSource("~/maildir-buildbot") 
    31933179@end example 
    31943180 
     
    33073293components after. 
    33083294 
    33093295@example 
    3310 import buildbot.changes.p4poller 
    3311 s = p4poller.P4Source(p4base='//depot/project/', 
    3312                       split_file=lambda branchfile: branchfile.split('/',1), 
    3313                      ) 
     3296s = P4Source(p4base='//depot/project/', 
     3297             split_file=lambda branchfile: branchfile.split('/',1)) 
    33143298c['change_source'] = s 
    33153299@end example 
    33163300 
     
    34503434nothing else), we would use the following: 
    34513435 
    34523436@example 
    3453 from buildbot.changes.svnpoller import SVNPoller 
    34543437c['change_source'] = SVNPoller("svn://svn.twistedmatrix.com/svn/Twisted/trunk") 
    34553438@end example 
    34563439 
     
    35033486multiple branches, we would use this: 
    35043487 
    35053488@example 
    3506 from buildbot.changes.svnpoller import SVNPoller, split_file_branches 
    35073489c['change_source'] = SVNPoller("svn://svn.twistedmatrix.com/svn/Twisted", 
    35083490                               split_file=split_file_branches) 
    35093491@end example 
     
    35433525described earlier: 
    35443526 
    35453527@example 
    3546 from buildbot.changes.svnpoller import SVNPoller 
    35473528c['change_source'] = SVNPoller("http://divmod.org/svn/Divmod/trunk/Nevow") 
    35483529@end example 
    35493530 
     
    35563537as figuring out which branch each one is on. 
    35573538 
    35583539@example 
    3559 from buildbot.changes.svnpoller import SVNPoller 
    35603540c['change_source'] = SVNPoller("http://divmod.org/svn/Divmod", 
    35613541                               split_file=my_file_splitter) 
    35623542@end example 
     
    37353715the @code{addStep} method: 
    37363716 
    37373717@example 
    3738 from buildbot.steps import source, shell 
    3739 from buildbot.process import factory 
    3740  
    3741 f = factory.BuildFactory() 
    3742 f.addStep(source.SVN(svnurl="http://svn.example.org/Trunk/")) 
    3743 f.addStep(shell.ShellCommand(command=["make", "all"])) 
    3744 f.addStep(shell.ShellCommand(command=["make", "test"])) 
     3718f = BuildFactory() 
     3719f.addStep(SVN(svnurl="http://svn.example.org/Trunk/")) 
     3720f.addStep(ShellCommand(command=["make", "all"])) 
     3721f.addStep(ShellCommand(command=["make", "test"])) 
    37453722@end example 
    37463723 
    37473724In earlier versions (0.7.5 and older), these steps were specified with 
     
    40774054branch, and file. 
    40784055 
    40794056@example 
    4080 from buildbot.changes.pb import PBChangeSource 
    4081 from buildbot.scheduler import AnyBranchScheduler 
    4082 from buildbot.process import source, factory 
    4083 from buildbot.steps import source, shell 
    4084  
    40854057c['change_source'] = PBChangeSource() 
    40864058s1 = AnyBranchScheduler('main', 
    40874059                        ['trunk', 'features/newthing', 'features/otherthing'], 
    40884060                        10*60, ['test-i386', 'test-ppc']) 
    40894061c['schedulers'] = [s1] 
    40904062 
    4091 f = factory.BuildFactory() 
    4092 f.addStep(source.SVN(mode='update', 
    4093                      baseURL='svn://svn.example.org/MyProject/', 
    4094                      defaultBranch='trunk')) 
    4095 f.addStep(shell.Compile(command="make all")) 
    4096 f.addStep(shell.Test(command="make test")) 
     4063f = BuildFactory() 
     4064f.addStep(SVN(mode='update', 
     4065              baseURL='svn://svn.example.org/MyProject/', 
     4066              defaultBranch='trunk')) 
     4067f.addStep(Compile(command="make all")) 
     4068f.addStep(Test(command="make test")) 
    40974069 
    40984070c['builders'] = [ 
    40994071  @{'name':'test-i386', 'slavename':'bot-i386', 'builddir':'test-i386', 
     
    46064578properties. 
    46074579 
    46084580@example 
    4609 from buildbot.steps.shell import ShellCommand, WithProperties 
    4610  
    46114581f.addStep(ShellCommand, 
    46124582          command=["tar", "czf", 
    46134583                   WithProperties("build-%s.tar.gz", "revision"), 
     
    47564726same place where the generated install tarball is placed. 
    47574727 
    47584728@example 
    4759 from buildbot.steps.python import BuildEPYDoc 
    4760  
    4761 ... 
    47624729f.addStep(BuildEPYDoc, command=["epydoc", "-o", "apiref", "source/mypkg"]) 
    47634730@end example 
    47644731 
     
    47834750@command{pyflakes .} or @command{pyflakes src}. 
    47844751 
    47854752@example 
    4786 from buildbot.steps.python import PyFlakes 
    4787  
    4788 ... 
    47894753f.addStep(PyFlakes, command=["pyflakes", "src"]) 
    47904754@end example 
    47914755 
     
    48154779master-side @file{~/public_html/ref.html}. 
    48164780 
    48174781@example 
    4818 from buildbot.steps.shell import ShellCommand 
    4819 from buildbot.steps.transfer import FileUpload 
    4820  
    48214782f.addStep(ShellCommand, command=["make", "docs"]) 
    48224783f.addStep(FileUpload, 
    48234784          slavesrc="docs/reference.html", 
     
    48384799side: 
    48394800 
    48404801@example 
    4841 from buildbot.steps.shell import ShellCommand 
    4842 from buildbot.steps.transfer import FileUpload 
    4843  
    48444802f.addStep(FileDownload 
    48454803          mastersrc="~/todays_build_config.txt", 
    48464804          slavedest="build_config.txt") 
     
    48864844@pxref{Build Dependencies} is the Trigger BuildStep. 
    48874845 
    48884846@example 
    4889 from buildbot.steps.trigger import Trigger 
    48904847f.addStep(Trigger, schedulerNames=['build-prep'], 
    48914848                   waitForFinish=True, 
    48924849                   updateSourceStamp=True) 
     
    51855142 
    51865143@example 
    51875144# START 
    5188 from buildbot.steps.shell import ShellCommand 
     5145from buildbot.config import ShellCommand 
    51895146from buildbot.process.buildstep import LogLineObserver 
    51905147 
    51915148class FNURRRGHCounter(LogLineObserver): 
     
    55105467from happening at the same time. 
    55115468 
    55125469@example 
    5513 from buildbot import locks 
    5514 from buildbot.steps import source, shell 
    5515 from buildbot.process import factory 
    5516  
    5517 db_lock = locks.MasterLock("database") 
    5518 f = factory.BuildFactory() 
     5470db_lock = MasterLock("database") 
     5471f = BuildFactory() 
    55195472f.addStep(source.SVN(svnurl="http://example.org/svn/Trunk")) 
    5520 f.addStep(shell.ShellCommand(command="make all")) 
    5521 f.addStep(shell.ShellCommand(command="make test", locks=[db_lock])) 
     5473f.addStep(ShellCommand(command="make all")) 
     5474f.addStep(ShellCommand(command="make test", locks=[db_lock])) 
    55225475b1 = @{'name': 'full1', 'slavename': 'bot-1', builddir='f1', 'factory': f@} 
    55235476b2 = @{'name': 'full2', 'slavename': 'bot-2', builddir='f2', 'factory': f@} 
    55245477b3 = @{'name': 'full3', 'slavename': 'bot-3', builddir='f3', 'factory': f@} 
     
    55395492goal of two simultaneous builds per slave. 
    55405493 
    55415494@example 
    5542 from buildbot import locks 
    5543 from buildbot.steps import source 
    5544 from buildbot.process import s, factory 
    5545  
    5546 slow_lock = locks.SlaveLock("cpu", maxCount=2) 
    5547 source = s(source.SVN, svnurl="http://example.org/svn/Trunk") 
     5495slow_lock = SlaveLock("cpu", maxCount=2) 
     5496source = source.SVN(svnurl="http://example.org/svn/Trunk") 
    55485497f22 = factory.Trial(source, trialpython=["python2.2"]) 
    5549 f23 = factory.Trial(source, trialpython=["python2.3"]) 
    5550 f24 = factory.Trial(source, trialpython=["python2.4"]) 
     5498f23 = Trial(source, trialpython=["python2.3"]) 
     5499f24 = Trial(source, trialpython=["python2.4"]) 
    55515500b1 = @{'name': 'p22', 'slavename': 'bot-1', builddir='p22', 'factory': f22, 
    55525501      'locks': [slow_lock] @} 
    55535502b2 = @{'name': 'p23', 'slavename': 'bot-1', builddir='p23', 'factory': f23, 
     
    55685517unlimited concurrent builds on the fast machine. 
    55695518 
    55705519@example 
    5571 from buildbot import locks 
    5572 from buildbot.steps import source, shell 
    5573 from buildbot.process import factory 
    5574  
    5575 db_lock = locks.MasterLock("database") 
     5520db_lock = MasterLock("database") 
    55765521slavecounts = @{"bot-slow": 1, "bot-fast": 100@} 
    5577 cpu_lock = locks.SlaveLock("cpu", maxCountForSlave=slavecounts) 
    5578 f = factory.BuildFactory() 
    5579 f.addStep(source.SVN(svnurl="http://example.org/svn/Trunk")) 
    5580 f.addStep(shell.ShellCommand(command="make all", locks=[cpu_lock])) 
    5581 f.addStep(shell.ShellCommand(command="make test", locks=[cpu_lock])) 
    5582 f.addStep(shell.ShellCommand(command="make db-test", locks=[db_lock, cpu_lock])) 
     5522cpu_lock = SlaveLock("cpu", maxCountForSlave=slavecounts) 
     5523f = BuildFactory() 
     5524f.addStep(SVN(svnurl="http://example.org/svn/Trunk")) 
     5525f.addStep(ShellCommand(command="make all", locks=[cpu_lock])) 
     5526f.addStep(ShellCommand(command="make test", locks=[cpu_lock])) 
     5527f.addStep(ShellCommand(command="make db-test", locks=[db_lock, cpu_lock])) 
    55835528 
    55845529b1 = @{'name': 'full1', 'slavename': 'bot-slow', builddir='full1', 
    55855530      'factory': f@} 
     
    57005645@code{make build} would be constructed as follows: 
    57015646 
    57025647@example 
    5703 from buildbot.steps import source, shell 
    5704 from buildbot.process import factory 
    5705  
    5706 f = factory.BuildFactory() 
    5707 f.addStep(source.CVS(cvsroot=CVSROOT, cvsmodule="project", mode="update")) 
    5708 f.addStep(shell.Compile(command=["make", "build"])) 
     5648f = BuildFactory() 
     5649f.addStep(CVS(cvsroot=CVSROOT, cvsmodule="project", mode="update")) 
     5650f.addStep(Compile(command=["make", "build"])) 
    57095651@end example 
    57105652 
    57115653(To support config files from buildbot-0.7.5 and earlier, 
     
    57235665create the list of steps ahead of time.: 
    57245666 
    57255667@example 
    5726 from buildbot.steps import source, shell 
    5727 from buildbot.process import factory 
    5728  
    5729 all_steps = [source.CVS(cvsroot=CVSROOT, cvsmodule="project", mode="update"), 
    5730              shell.Compile(command=["make", "build"]), 
     5668all_steps = [CVS(cvsroot=CVSROOT, cvsmodule="project", mode="update"), 
     5669             Compile(command=["make", "build"]), 
    57315670            ] 
    5732 f = factory.BuildFactory(all_steps) 
     5671f = BuildFactory(all_steps) 
    57335672@end example 
    57345673 
    57355674 
     
    62446183clients. 
    62456184 
    62466185@example 
    6247 from buildbot.status.html import WebStatus 
    62486186c['status'].append(WebStatus(8080)) 
    62496187@end example 
    62506188 
     
    62806218@code{WebStatus} instance; this is called the @code{http_port} argument: 
    62816219 
    62826220@example 
    6283 from buildbot.status.html import WebStatus 
    62846221c['status'].append(WebStatus(8080)) 
    62856222@end example 
    62866223 
     
    65546491from a future release. 
    65556492 
    65566493@example 
    6557 from buildbot.status import html 
    6558 w = html.Waterfall(http_port=8080) 
     6494w = Waterfall(http_port=8080) 
    65596495c['status'].append(w) 
    65606496@end example 
    65616497 
     
    65976533and URLs where more information can be obtained. 
    65986534 
    65996535@example 
    6600 from buildbot.status.mail import MailNotifier 
    66016536mn = MailNotifier(fromaddr="buildbot@@example.org", lookup="example.org") 
    66026537c['status'].append(mn) 
    66036538@end example 
     
    66966631told to shut up. 
    66976632 
    66986633@example 
    6699 from buildbot.status import words 
    6700 irc = words.IRC("irc.example.org", "botnickname",  
    6701                 channels=["channel1", "channel2"], 
    6702                 password="mysecretpassword") 
     6634irc = IRC("irc.example.org", "botnickname",  
     6635          channels=["channel1", "channel2"], 
     6636          password="mysecretpassword") 
    67036637c['status'].append(irc) 
    67046638@end example 
    67056639 
     
    67636697 
    67646698 
    67656699@example 
    6766 import buildbot.status.client 
    6767 pbl = buildbot.status.client.PBListener(port=int, user=str, 
    6768                                         passwd=str) 
     6700pbl = PBListener(port=int, user=str, passwd=str) 
    67696701c['status'].append(pbl) 
    67706702@end example 
    67716703 
     
    70446976buildmaster's config file: 
    70456977 
    70466978@example 
    7047 from buildbot.scheduler import Try_Jobdir 
    70486979s = Try_Jobdir("try1", ["full-linux", "full-netbsd", "full-OSX"], 
    70496980               jobdir="jobdir") 
    70506981c['schedulers'] = [s] 
     
    70666997buildslave accounts depends upon it: 
    70676998 
    70686999@example 
    7069 from buildbot.scheduler import Try_Userpass 
    70707000s = Try_Userpass("try2", ["full-linux", "full-netbsd", "full-OSX"], 
    70717001                 port=8031, userpass=[("alice","pw1"), ("bob", "pw2")] ) 
    70727002c['schedulers'] = [s] 
  • old-docwork/docs/examples/hello.cfg

    old new  
    11#! /usr/bin/python 
    22 
    3 from buildbot import master 
    4 from buildbot.buildslave import BuildSlave 
    5 from buildbot.process import factory 
    6 from buildbot.steps.source import CVS, SVN, Darcs, Arch 
    7 from buildbot.steps.shell import Configure, Compile, Test 
    8 from buildbot.status import html, client 
    9 from buildbot.changes.pb import PBChangeSource 
     3from buildbot.config import * 
    104 
    115BuildmasterConfig = c = {} 
    126 
     
    1610c['builders'] = [] 
    1711 
    1812if True: 
    19     f = factory.BuildFactory() 
     13    f = BuildFactory() 
    2014    f.addStep(CVS(cvsroot="/usr/home/warner/stuff/Projects/BuildBot/demo/Repository", 
    2115                  cvsmodule="hello", 
    2216                  mode="clobber", 
     
    3529 
    3630if True: 
    3731    svnrep="file:///usr/home/warner/stuff/Projects/BuildBot/demo/SVN-Repository" 
    38     f = factory.BuildFactory() 
     32    f = BuildFactory() 
    3933    f.addStep(SVN(svnurl=svnrep+"/hello", mode="update")) 
    4034    f.addStep(Configure()) 
    4135    f.addStep(Compile()), 
     
    4842    c['builders'].append(b1) 
    4943 
    5044if True: 
    51     f = factory.BuildFactory() 
     45    f = BuildFactory() 
    5246    f.addStep(Darcs(repourl="http://localhost/~warner/hello-darcs", 
    5347                    mode="copy")) 
    5448    f.addStep(Configure(command=["/bin/sh", "./configure"])) 
     
    6256    c['builders'].append(b1) 
    6357 
    6458if True: 
    65     f = factory.BuildFactory() 
     59    f = BuildFactory() 
    6660    f.addStep(Arch(url="http://localhost/~warner/hello-arch", 
    6761                   version="gnu-hello--release--2.1.1", 
    6862                   mode="copy", 
     
    8478 
    8579c['slavePortnum'] = 8007 
    8680c['debugPassword'] = "asdf" 
    87 c['manhole'] = master.Manhole(9900, "username", "password") 
     81from buildbot.manhole import PasswordManhole 
     82c['manhole'] = PasswordManhole("tcp:9900:interface=127.0.0.1", 
     83                               "username", "password") 
    8884 
    89 c['status'] = [html.WebStatus(http_port=8080), 
    90                client.PBListener(port=8008), 
     85c['status'] = [WebStatus(http_port=8080), 
     86               PBListener(port=8008), 
    9187               ] 
    9288