Ticket #238: 238.patch
| File 238.patch, 32.5 kB (added by dustin, 9 months ago) |
|---|
-
old-docwork/buildbot/scripts/sample.cfg
old new 1 1 # -*- python -*- 2 2 # ex: set syntax=python: 3 3 4 from buildbot.config import * 5 4 6 # This is a sample buildmaster config file. It must be installed as 5 7 # 'master.cfg' in your buildmaster's base directory (although the filename 6 8 # can be changed with the --basedir option to 'mktap buildbot master'). … … 19 21 # the 'slaves' list defines the set of allowable buildslaves. Each element is 20 22 # a tuple of bot-name and bot-password. These correspond to values given to 21 23 # the buildslave's mktap invocation. 22 from buildbot.buildslave import BuildSlave23 24 c['slaves'] = [BuildSlave("bot1name", "bot1passwd")] 24 25 25 26 # to limit to two concurrent builds on a slave, use … … 37 38 # about source code changes. Any class which implements IChangeSource can be 38 39 # put here: there are several in buildbot/changes/*.py to choose from. 39 40 40 from buildbot.changes.pb import PBChangeSource41 41 c['change_source'] = PBChangeSource() 42 42 43 43 # For example, if you had CVSToys installed on your repository, and your … … 65 65 66 66 ## configure the Schedulers 67 67 68 from buildbot.scheduler import Scheduler69 68 c['schedulers'] = [] 70 69 c['schedulers'].append(Scheduler(name="all", branch=None, 71 70 treeStableTimer=2*60, … … 95 94 cvsroot = ":pserver:anonymous@cvs.sourceforge.net:/cvsroot/buildbot" 96 95 cvsmodule = "buildbot" 97 96 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() 97 f1 = BuildFactory() 103 98 f1.addStep(CVS(cvsroot=cvsroot, cvsmodule=cvsmodule, login="", mode="copy")) 104 99 f1.addStep(Compile(command=["python", "./setup.py", "build"])) 105 100 f1.addStep(Trial(testpath=".")) … … 120 115 121 116 c['status'] = [] 122 117 123 from buildbot.status import html 124 c['status'].append(html.WebStatus(http_port=8010)) 118 c['status'].append(WebStatus(http_port=8010)) 125 119 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)) 130 123 # 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"])) 134 126 # 135 # from buildbot.status import client 136 # c['status'].append(client.PBListener(9988)) 127 # c['status'].append(PBListener(9988)) 137 128 138 129 139 130 ####### DEBUGGING OPTIONS … … 151 142 # interactive python shell, which may be useful for debugging buildbot 152 143 # internals. It is probably only useful for buildbot developers. You can also 153 144 # use an authorized_keys file, or plain telnet. 154 #from buildbot import manhole155 #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") 157 148 158 149 159 150 ####### PROJECT IDENTITY -
old-docwork/docs/buildbot.texinfo
old new 1960 1960 'key2': 'value2'@} }. Function calls (and object instantiation) can use 1961 1961 named parameters, like @code{w = html.Waterfall(http_port=8010)}. 1962 1962 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 1963 The config file usually starts with the following lines: 1964 @example 1965 from buildbot.config import * 1966 BuildmasterConfig = c = @{@} 1967 @end example 1986 1968 1987 The config file can use a few names which are placed into its namespace: 1969 The first line imports all of the symbols typically used 1970 in a configuration file. The next line creates the main 1971 @code{BuildmasterConfig} variable, containing a dictionary which 1972 is the output of the configuration. It also creates the shorter 1973 name @code{c} for this dictionary. 1988 1974 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'))} 1975 The remainder of this chapter describes the various keys for this 1976 dictionary, generally created with code such as 1995 1977 1996 @end table 1978 @example 1979 c['projectName'] = "Buildbot" 1980 @end example 1997 1981 1982 The config file can use a the variable @code{basedir}, which 1983 is the base directory for the buildmaster. This string has not 1984 been expanded, so it may start with a tilde. It needs to be 1985 expanded before use. To generate the pathname of a file named 1986 @code{info.txt} in the same directory as the configuration file, 1987 use @code{os.path.expanduser(os.path.join(basedir, 'info.txt'))} 1998 1988 1999 1989 @node Loading the Config File, Testing the Config File, Config File Format, Configuration 2000 1990 @section Loading the Config File … … 2127 2117 Code Changes}. 2128 2118 2129 2119 @example 2130 from buildbot.changes.pb import PBChangeSource2131 2120 c['change_source'] = PBChangeSource() 2132 2121 @end example 2133 2122 … … 2176 2165 @end table 2177 2166 2178 2167 @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) 2168 quick = Scheduler("quick", None, 60, 2169 ["quick-linux", "quick-netbsd"]) 2170 full = Scheduler("full", None, 5*60, 2171 ["full-linux", "full-netbsd", "full-OSX"]) 2172 nightly = Periodic("nightly", ["full-solaris"], 24*60*60) 2185 2173 c['schedulers'] = [quick, full, nightly] 2186 2174 @end example 2187 2175 … … 2299 2287 the downstream builds will not fire. 2300 2288 2301 2289 @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"]) 2290 tests = Scheduler("tests", None, 5*60, 2291 ["full-linux", "full-netbsd", "full-OSX"]) 2292 package = Dependent("package", 2293 tests, # upstream scheduler 2294 ["make-tarball", "make-deb", "make-rpm"]) 2308 2295 c['schedulers'] = [tests, package] 2309 2296 @end example 2310 2297 … … 2323 2310 perform some work for them, perhaps on other buildslaves. 2324 2311 2325 2312 @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"]) 2313 checkin = Scheduler("checkin", None, 5*60, ["checkin"]) 2314 nightly = Scheduler("nightly", ... , ["nightly"]) 2331 2315 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"])2316 mktarball = Triggerable("mktarball", 2317 ["mktarball"]) 2318 build = Triggerable("build-all-platforms", 2319 ["build-all-platforms"]) 2320 test = Triggerable("distributed-test", 2321 ["distributed-test"]) 2322 package = Triggerable("package-all-platforms", 2323 ["package-all-platforms"]) 2340 2324 2341 2325 c['schedulers'] = [checkin, nightly, build, test, package] 2342 2326 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)2327 checkin_factory = BuildFactory() 2328 f.addStep(Trigger('mktarball', schedulers=['mktarball'], 2329 waitForFinish=True) 2330 f.addStep(Trigger('build', schedulers=['build-all-platforms'], 2331 waitForFinish=True) 2332 f.addStep(Trigger('test', schedulers=['distributed-test'], 2333 waitForFinish=True) 2334 2335 nightly_factory = BuildFactory() 2336 f.addStep(Trigger('mktarball', schedulers=['mktarball'], 2337 waitForFinish=True) 2338 f.addStep(Trigger('build', schedulers=['build-all-platforms'], 2339 waitForFinish=True) 2340 f.addStep(Trigger('package', schedulers=['package-all-platforms'], 2341 waitForFinish=True) 2358 2342 @end example 2359 2343 2360 2344 @node Setting the slaveport, Buildslave Specifiers, Listing Change Sources and Schedulers, Configuration … … 2406 2390 they create the buildslave. 2407 2391 2408 2392 @example 2409 from buildbot.buildslave import BuildSlave2410 2393 c['slaves'] = [BuildSlave('bot-solaris', 'solarispasswd'), 2411 2394 BuildSlave('bot-bsd', 'bsdpasswd'), 2412 2395 ] … … 2426 2409 execute simultaneously: 2427 2410 2428 2411 @example 2429 from buildbot.buildslave import BuildSlave2430 2412 c['slaves'] = [BuildSlave("bot-linux", "linuxpassword", max_builds=2)] 2431 2413 @end example 2432 2414 … … 2488 2470 builders=[], as follows: 2489 2471 2490 2472 @example 2491 from buildbot.status import mail 2492 m = mail.MailNotifier(fromaddr="buildbot@@localhost", builders=[], 2493 relayhost="smtp.example.org") 2473 m = MailNotifier(fromaddr="buildbot@@localhost", builders=[], 2474 relayhost="smtp.example.org") 2494 2475 c['status'].append(m) 2495 2476 c['slaves'] = [BuildSlave('bot-solaris', 'solarispasswd', 2496 2477 notify_on_missing="bob@@example.com"), … … 2591 2572 @example 2592 2573 c['status'] = [] 2593 2574 2594 from buildbot.status import html 2595 c['status'].append(html.Waterfall(http_port=8010)) 2575 c['status'].append(Waterfall(http_port=8010)) 2596 2576 2597 from buildbot.status import mail 2598 m = mail.MailNotifier(fromaddr="buildbot@@localhost", 2599 extraRecipients=["builds@@lists.example.com"], 2600 sendToInterestedUsers=False) 2577 m = MailNotifier(fromaddr="buildbot@@localhost", 2578 extraRecipients=["builds@@lists.example.com"], 2579 sendToInterestedUsers=False) 2601 2580 c['status'].append(m) 2602 2581 2603 from buildbot.status import words 2604 c['status'].append(words.IRC(host="irc.example.com", nick="bb", 2605 channels=["#example"])) 2582 c['status'].append(IRC(host="irc.example.com", nick="bb", 2583 channels=["#example"])) 2606 2584 @end example 2607 2585 2608 2586 Status delivery has its own chapter, @xref{Status Delivery}, in which … … 2640 2618 one uses unencrypted telnet. Two of them use a username+password 2641 2619 combination to grant access, one of them uses an SSH-style 2642 2620 @file{authorized_keys} file which contains a list of ssh public keys. 2621 These modules are for advanced users, so they are not included in 2622 @code{buildbot.config} and must be imported explicitly. 2643 2623 2644 2624 @table @code 2645 2625 @item manhole.AuthorizedKeysManhole … … 2663 2643 highly recommended that you use one of the SSH manholes instead. 2664 2644 2665 2645 @end table 2666 2646 Examples: 2667 2647 @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") 2648 from buildbot.manhole import AuthorizedKeysManhole 2649 c['manhole'] = AuthorizedKeysManhole(1234, "authorized_keys") 2650 2651 from buildbot.manhole import PasswordManhole 2652 c['manhole'] = PasswordManhole(1234, "alice", "mysecretpassword") 2653 2654 from buildbot.manhole import TelnetManhole 2655 c['manhole'] = TelnetManhole(1234, "bob", "snoop_my_password_please") 2673 2656 @end example 2674 2657 2675 2658 The @code{Manhole} instance can be configured to listen on a specific … … 2786 2769 @end itemize 2787 2770 2788 2771 As 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. 2772 that might be useful with them. 2791 2773 2792 2774 @table @code 2793 2775 @item CVS 2794 2776 2795 2777 @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{buildbot2778 @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 2801 2783 sendchange} run in a loginfo script) 2802 @item pb.PBChangeSource (listening for connections from a long-running2784 @item PBChangeSource (listening for connections from a long-running 2803 2785 @code{contrib/viewcvspoll.py} polling process which examines the ViewCVS 2804 2786 database directly 2805 2787 @end itemize 2806 2788 2807 2789 @item SVN 2808 2790 @itemize @bullet 2809 @item pb.PBChangeSource (listening for connections from2791 @item PBChangeSource (listening for connections from 2810 2792 @code{contrib/svn_buildbot.py} run in a postcommit script) 2811 @item pb.PBChangeSource (listening for connections from a long-running2793 @item PBChangeSource (listening for connections from a long-running 2812 2794 @code{contrib/svn_watcher.py} or @code{contrib/svnpoller.py} polling 2813 2795 process 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) 2816 2798 @end itemize 2817 2799 2818 2800 @item Darcs 2819 2801 @itemize @bullet 2820 @item pb.PBChangeSource (listening for connections from2802 @item PBChangeSource (listening for connections from 2821 2803 @code{contrib/darcs_buildbot.py} in a commit script 2822 2804 @end itemize 2823 2805 2824 2806 @item Mercurial 2825 2807 @itemize @bullet 2826 @item pb.PBChangeSource (listening for connections from2808 @item PBChangeSource (listening for connections from 2827 2809 @code{contrib/hg_buildbot.py} run in an 'incoming' hook) 2828 @item pb.PBChangeSource (listening for connections from2810 @item PBChangeSource (listening for connections from 2829 2811 @code{buildbot/changes/hgbuildbot.py} run as an in-process 'changegroup' 2830 2812 hook) 2831 2813 @end itemize 2832 2814 2833 2815 @item Arch/Bazaar 2834 2816 @itemize @bullet 2835 @item pb.PBChangeSource (listening for connections from2817 @item PBChangeSource (listening for connections from 2836 2818 @code{contrib/arch_buildbot.py} run in a commit hook) 2837 2819 @end itemize 2838 2820 2839 2821 @item Git 2840 2822 @itemize @bullet 2841 @item pb.PBChangeSource (listening for connections from2823 @item PBChangeSource (listening for connections from 2842 2824 @code{contrib/git_buildbot.py} run in the post-receive hook) 2843 2825 @end itemize 2844 2826 … … 2862 2844 Each buildmaster typically has just a single ChangeSource, since it is 2863 2845 only watching a single source tree. But if, for some reason, you need 2864 2846 multiple sources, just set @code{c['change_source']} to a list of 2865 ChangeSources ..it will accept that too.2847 ChangeSources -- it will accept that too. 2866 2848 2867 2849 @example 2850 from buildbot.changes.freshcvs import FreshCVSSourceNewcred 2868 2851 s = FreshCVSSourceNewcred(host="host", port=4519, 2869 2852 user="alice", passwd="secret", 2870 2853 prefix="Twisted") … … 2894 2877 works by listening on a TCP port for clients. These clients subscribe 2895 2878 to hear about commit notifications. 2896 2879 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. 2880 The buildmaster has a CVSToys-compatible @code{PBService} client 2881 built in. There are two versions of it, one for old versions 2882 of CVSToys (1.0.9 and earlier) which used the @code{oldcred} 2883 authentication framework, and one for newer versions (1.0.10 2884 and later) which use @code{newcred}. Both are classes in the 2885 @code{buildbot.changes.freshcvs} package. Because CVSToys is 2886 not installed on all systems, these symbols are not included in 2887 @code{buildbot.config} and must be imported explicitly: 2888 2889 @example 2890 from buildbot.changes.freshcvs import FreshCVSSourceOldcred 2891 from buildbot.changes.freshcvs import FreshCVSSourceNewcred 2892 @end example 2903 2893 2904 2894 @code{FreshCVSSourceNewcred} objects are created with the following 2905 2895 parameters: … … 2940 2930 Then add a clause like this to your buildmaster's @file{master.cfg}: 2941 2931 2942 2932 @example 2933 from buildbot.changes.freshcvs import FreshCVSSource 2943 2934 BuildmasterConfig['change_source'] = FreshCVSSource("cvs.example.com", 4519, 2944 2935 "foo", "bar", 2945 2936 prefix="glib/") … … 2986 2977 the change source and put it in @code{c['change_source']}: 2987 2978 2988 2979 @example 2989 from buildbot.changes.mail import SyncmailMaildirSource2990 2980 c['change_source'] = SyncmailMaildirSource("~/maildir-buildbot", 2991 2981 prefix="/trunk/") 2992 2982 @end example … … 3141 3131 strip. 3142 3132 3143 3133 @example 3144 from buildbot.changes.mail import FCMaildirSource3145 3134 c['change_source'] = FCMaildirSource("~/maildir-buildbot") 3146 3135 @end example 3147 3136 … … 3156 3145 the CVS ``syncmail'' script. 3157 3146 3158 3147 @example 3159 from buildbot.changes.mail import SyncmailMaildirSource3160 3148 c['change_source'] = SyncmailMaildirSource("~/maildir-buildbot") 3161 3149 @end example 3162 3150 … … 3171 3159 tree-management system built by Mozilla. 3172 3160 3173 3161 @example 3174 from buildbot.changes.mail import BonsaiMaildirSource3175 3162 c['change_source'] = BonsaiMaildirSource("~/maildir-buildbot") 3176 3163 @end example 3177 3164 … … 3188 3175 it creates will be associated with the default (i.e. trunk) branch. 3189 3176 3190 3177 @example 3191 from buildbot.changes.mail import SVNCommitEmailMaildirSource3192 3178 c['change_source'] = SVNCommitEmailMaildirSource("~/maildir-buildbot") 3193 3179 @end example 3194 3180 … … 3307 3293 components after. 3308 3294 3309 3295 @example 3310 import buildbot.changes.p4poller 3311 s = p4poller.P4Source(p4base='//depot/project/', 3312 split_file=lambda branchfile: branchfile.split('/',1), 3313 ) 3296 s = P4Source(p4base='//depot/project/', 3297 split_file=lambda branchfile: branchfile.split('/',1)) 3314 3298 c['change_source'] = s 3315 3299 @end example 3316 3300 … … 3450 3434 nothing else), we would use the following: 3451 3435 3452 3436 @example 3453 from buildbot.changes.svnpoller import SVNPoller3454 3437 c['change_source'] = SVNPoller("svn://svn.twistedmatrix.com/svn/Twisted/trunk") 3455 3438 @end example 3456 3439 … … 3503 3486 multiple branches, we would use this: 3504 3487 3505 3488 @example 3506 from buildbot.changes.svnpoller import SVNPoller, split_file_branches3507 3489 c['change_source'] = SVNPoller("svn://svn.twistedmatrix.com/svn/Twisted", 3508 3490 split_file=split_file_branches) 3509 3491 @end example … … 3543 3525 described earlier: 3544 3526 3545 3527 @example 3546 from buildbot.changes.svnpoller import SVNPoller3547 3528 c['change_source'] = SVNPoller("http://divmod.org/svn/Divmod/trunk/Nevow") 3548 3529 @end example 3549 3530 … … 3556 3537 as figuring out which branch each one is on. 3557 3538 3558 3539 @example 3559 from buildbot.changes.svnpoller import SVNPoller3560 3540 c['change_source'] = SVNPoller("http://divmod.org/svn/Divmod", 3561 3541 split_file=my_file_splitter) 3562 3542 @end example … … 3735 3715 the @code{addStep} method: 3736 3716 3737 3717 @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"])) 3718 f = BuildFactory() 3719 f.addStep(SVN(svnurl="http://svn.example.org/Trunk/")) 3720 f.addStep(ShellCommand(command=["make", "all"])) 3721 f.addStep(ShellCommand(command=["make", "test"])) 3745 3722 @end example 3746 3723 3747 3724 In earlier versions (0.7.5 and older), these steps were specified with … … 4077 4054 branch, and file. 4078 4055 4079 4056 @example 4080 from buildbot.changes.pb import PBChangeSource4081 from buildbot.scheduler import AnyBranchScheduler4082 from buildbot.process import source, factory4083 from buildbot.steps import source, shell4084 4085 4057 c['change_source'] = PBChangeSource() 4086 4058 s1 = AnyBranchScheduler('main', 4087 4059 ['trunk', 'features/newthing', 'features/otherthing'], 4088 4060 10*60, ['test-i386', 'test-ppc']) 4089 4061 c['schedulers'] = [s1] 4090 4062 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"))4063 f = BuildFactory() 4064 f.addStep(SVN(mode='update', 4065 baseURL='svn://svn.example.org/MyProject/', 4066 defaultBranch='trunk')) 4067 f.addStep(Compile(command="make all")) 4068 f.addStep(Test(command="make test")) 4097 4069 4098 4070 c['builders'] = [ 4099 4071 @{'name':'test-i386', 'slavename':'bot-i386', 'builddir':'test-i386', … … 4606 4578 properties. 4607 4579 4608 4580 @example 4609 from buildbot.steps.shell import ShellCommand, WithProperties4610 4611 4581 f.addStep(ShellCommand, 4612 4582 command=["tar", "czf", 4613 4583 WithProperties("build-%s.tar.gz", "revision"), … … 4756 4726 same place where the generated install tarball is placed. 4757 4727 4758 4728 @example 4759 from buildbot.steps.python import BuildEPYDoc4760 4761 ...4762 4729 f.addStep(BuildEPYDoc, command=["epydoc", "-o", "apiref", "source/mypkg"]) 4763 4730 @end example 4764 4731 … … 4783 4750 @command{pyflakes .} or @command{pyflakes src}. 4784 4751 4785 4752 @example 4786 from buildbot.steps.python import PyFlakes4787 4788 ...4789 4753 f.addStep(PyFlakes, command=["pyflakes", "src"]) 4790 4754 @end example 4791 4755 … … 4815 4779 master-side @file{~/public_html/ref.html}. 4816 4780 4817 4781 @example 4818 from buildbot.steps.shell import ShellCommand4819 from buildbot.steps.transfer import FileUpload4820 4821 4782 f.addStep(ShellCommand, command=["make", "docs"]) 4822 4783 f.addStep(FileUpload, 4823 4784 slavesrc="docs/reference.html", … … 4838 4799 side: 4839 4800 4840 4801 @example 4841 from buildbot.steps.shell import ShellCommand4842 from buildbot.steps.transfer import FileUpload4843 4844 4802 f.addStep(FileDownload 4845 4803 mastersrc="~/todays_build_config.txt", 4846 4804 slavedest="build_config.txt") … … 4886 4844 @pxref{Build Dependencies} is the Trigger BuildStep. 4887 4845 4888 4846 @example 4889 from buildbot.steps.trigger import Trigger4890 4847 f.addStep(Trigger, schedulerNames=['build-prep'], 4891 4848 waitForFinish=True, 4892 4849 updateSourceStamp=True) … … 5185 5142 5186 5143 @example 5187 5144 # START 5188 from buildbot. steps.shellimport ShellCommand5145 from buildbot.config import ShellCommand 5189 5146 from buildbot.process.buildstep import LogLineObserver 5190 5147 5191 5148 class FNURRRGHCounter(LogLineObserver): … … 5510 5467 from happening at the same time. 5511 5468 5512 5469 @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() 5470 db_lock = MasterLock("database") 5471 f = BuildFactory() 5519 5472 f.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]))5473 f.addStep(ShellCommand(command="make all")) 5474 f.addStep(ShellCommand(command="make test", locks=[db_lock])) 5522 5475 b1 = @{'name': 'full1', 'slavename': 'bot-1', builddir='f1', 'factory': f@} 5523 5476 b2 = @{'name': 'full2', 'slavename': 'bot-2', builddir='f2', 'factory': f@} 5524 5477 b3 = @{'name': 'full3', 'slavename': 'bot-3', builddir='f3', 'factory': f@} … … 5539 5492 goal of two simultaneous builds per slave. 5540 5493 5541 5494 @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") 5495 slow_lock = SlaveLock("cpu", maxCount=2) 5496 source = source.SVN(svnurl="http://example.org/svn/Trunk") 5548 5497 f22 = factory.Trial(source, trialpython=["python2.2"]) 5549 f23 = factory.Trial(source, trialpython=["python2.3"])5550 f24 = factory.Trial(source, trialpython=["python2.4"])5498 f23 = Trial(source, trialpython=["python2.3"]) 5499 f24 = Trial(source, trialpython=["python2.4"]) 5551 5500 b1 = @{'name': 'p22', 'slavename': 'bot-1', builddir='p22', 'factory': f22, 5552 5501 'locks': [slow_lock] @} 5553 5502 b2 = @{'name': 'p23', 'slavename': 'bot-1', builddir='p23', 'factory': f23, … … 5568 5517 unlimited concurrent builds on the fast machine. 5569 5518 5570 5519 @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") 5520 db_lock = MasterLock("database") 5576 5521 slavecounts = @{"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]))5522 cpu_lock = SlaveLock("cpu", maxCountForSlave=slavecounts) 5523 f = BuildFactory() 5524 f.addStep(SVN(svnurl="http://example.org/svn/Trunk")) 5525 f.addStep(ShellCommand(command="make all", locks=[cpu_lock])) 5526 f.addStep(ShellCommand(command="make test", locks=[cpu_lock])) 5527 f.addStep(ShellCommand(command="make db-test", locks=[db_lock, cpu_lock])) 5583 5528 5584 5529 b1 = @{'name': 'full1', 'slavename': 'bot-slow', builddir='full1', 5585 5530 'factory': f@} … … 5700 5645 @code{make build} would be constructed as follows: 5701 5646 5702 5647 @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"])) 5648 f = BuildFactory() 5649 f.addStep(CVS(cvsroot=CVSROOT, cvsmodule="project", mode="update")) 5650 f.addStep(Compile(command=["make", "build"])) 5709 5651 @end example 5710 5652 5711 5653 (To support config files from buildbot-0.7.5 and earlier, … … 5723 5665 create the list of steps ahead of time.: 5724 5666 5725 5667 @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"]), 5668 all_steps = [CVS(cvsroot=CVSROOT, cvsmodule="project", mode="update"), 5669 Compile(command=["make", "build"]), 5731 5670 ] 5732 f = factory.BuildFactory(all_steps)5671 f = BuildFactory(all_steps) 5733 5672 @end example 5734 5673 5735 5674 … … 6244 6183 clients. 6245 6184 6246 6185 @example 6247 from buildbot.status.html import WebStatus6248 6186 c['status'].append(WebStatus(8080)) 6249 6187 @end example 6250 6188 … … 6280 6218 @code{WebStatus} instance; this is called the @code{http_port} argument: 6281 6219 6282 6220 @example 6283 from buildbot.status.html import WebStatus6284 6221 c['status'].append(WebStatus(8080)) 6285 6222 @end example 6286 6223 … … 6554 6491 from a future release. 6555 6492 6556 6493 @example 6557 from buildbot.status import html 6558 w = html.Waterfall(http_port=8080) 6494 w = Waterfall(http_port=8080) 6559 6495 c['status'].append(w) 6560 6496 @end example 6561 6497 … … 6597 6533 and URLs where more information can be obtained. 6598 6534 6599 6535 @example 6600 from buildbot.status.mail import MailNotifier6601 6536 mn = MailNotifier(fromaddr="buildbot@@example.org", lookup="example.org") 6602 6537 c['status'].append(mn) 6603 6538 @end example … … 6696 6631 told to shut up. 6697 6632 6698 6633 @example 6699 from buildbot.status import words 6700 irc = words.IRC("irc.example.org", "botnickname", 6701 channels=["channel1", "channel2"], 6702 password="mysecretpassword") 6634 irc = IRC("irc.example.org", "botnickname", 6635 channels=["channel1", "channel2"], 6636 password="mysecretpassword") 6703 6637 c['status'].append(irc) 6704 6638 @end example 6705 6639 … … 6763 6697 6764 6698 6765 6699 @example 6766 import buildbot.status.client 6767 pbl = buildbot.status.client.PBListener(port=int, user=str, 6768 passwd=str) 6700 pbl = PBListener(port=int, user=str, passwd=str) 6769 6701 c['status'].append(pbl) 6770 6702 @end example 6771 6703 … … 7044 6976 buildmaster's config file: 7045 6977 7046 6978 @example 7047 from buildbot.scheduler import Try_Jobdir7048 6979 s = Try_Jobdir("try1", ["full-linux", "full-netbsd", "full-OSX"], 7049 6980 jobdir="jobdir") 7050 6981 c['schedulers'] = [s] … … 7066 6997 buildslave accounts depends upon it: 7067 6998 7068 6999 @example 7069 from buildbot.scheduler import Try_Userpass7070 7000 s = Try_Userpass("try2", ["full-linux", "full-netbsd", "full-OSX"], 7071 7001 port=8031, userpass=[("alice","pw1"), ("bob", "pw2")] ) 7072 7002 c['schedulers'] = [s] -
old-docwork/docs/examples/hello.cfg
old new 1 1 #! /usr/bin/python 2 2 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 3 from buildbot.config import * 10 4 11 5 BuildmasterConfig = c = {} 12 6 … … 16 10 c['builders'] = [] 17 11 18 12 if True: 19 f = factory.BuildFactory()13 f = BuildFactory() 20 14 f.addStep(CVS(cvsroot="/usr/home/warner/stuff/Projects/BuildBot/demo/Repository", 21 15 cvsmodule="hello", 22 16 mode="clobber", … … 35 29 36 30 if True: 37 31 svnrep="file:///usr/home/warner/stuff/Projects/BuildBot/demo/SVN-Repository" 38 f = factory.BuildFactory()32 f = BuildFactory() 39 33 f.addStep(SVN(svnurl=svnrep+"/hello", mode="update")) 40 34 f.addStep(Configure()) 41 35 f.addStep(Compile()), … … 48 42 c['builders'].append(b1) 49 43 50 44 if True: 51 f = factory.BuildFactory()45 f = BuildFactory() 52 46 f.addStep(Darcs(repourl="http://localhost/~warner/hello-darcs", 53 47 mode="copy")) 54 48 f.addStep(Configure(command=["/bin/sh", "./configure"])) … … 62 56 c['builders'].append(b1) 63 57 64 58 if True: 65 f = factory.BuildFactory()59 f = BuildFactory() 66 60 f.addStep(Arch(url="http://localhost/~warner/hello-arch", 67 61 version="gnu-hello--release--2.1.1", 68 62 mode="copy", … … 84 78 85 79 c['slavePortnum'] = 8007 86 80 c['debugPassword'] = "asdf" 87 c['manhole'] = master.Manhole(9900, "username", "password") 81 from buildbot.manhole import PasswordManhole 82 c['manhole'] = PasswordManhole("tcp:9900:interface=127.0.0.1", 83 "username", "password") 88 84 89 c['status'] = [ html.WebStatus(http_port=8080),90 client.PBListener(port=8008),85 c['status'] = [WebStatus(http_port=8080), 86 PBListener(port=8008), 91 87 ] 92 88
![[Buildbot Logo]](/trac/chrome/site/header-text-transparent.png)