Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ========================================================
- def start(self):
- cmd = RemoteShellCommand(..)
- self.startCommand(cmd, warnings)
- # ========================================================
- def myMethod(self):
- d = ...
- d.addCallback(self._myMethod_2) # BAD!
- def _myMethod_2(self, res): # BAD!
- # ...
- # ========================================================
- def getRevInfo(revname):
- results = {}
- finished = dict(rev_parse=False, log=False)
- rev_parse_d = utils.getProcessOutput(git, [ 'rev-parse', revname ])
- def parse_rev_parse(res):
- return res.strip()
- rev_parse_d.addCallback(parse_rev_parse)
- log_d = utils.getProcessOutput(git, [ 'log', '-1', '--format=%s%n%b', results['rev'] ]))
- def parse_log(res):
- return res.strip()
- log_d.addCallback(parse_log)
- d = defer.DeferredList([rev_parse_d, log_d], consumeErrors=1, fireOnFirstErrback=1)
- def handle_results(results):
- return dict(rev=results[0][1], log=results[1][1])
- d.addCallback(handle_results)
- return d
- # ========================================================
- def pickNextBuild(builder, requests):
- # ...
- c['builders'] = [
- BuilderConfig(name='test', factory=f,
- nextBuild=pickNextBuild,
- slavenames=['slave1', 'slave2', 'slave3', 'slave4']),
- ]
- # ========================================================
- //depot/branch/mybranch/... //<p4client>/...
- -//depot/branch/mybranch/notthisdir/... //<p4client>/notthisdir/...
- # ========================================================
- .. directoryEnterPattern = "make.*: Entering directory [\"`'](.*)['`\"]"
- .. directoryLeavePattern = "make.*: Leaving directory"
- # ========================================================
- from buildbot.steps.slave import SetPropertiesFromEnv
- from buildbot.steps.shell import Compile
- f.addStep(SetPropertiesFromEnv(variables=["SOME_JAVA_LIB_HOME", "JAVAC"]))
- f.addStep(Compile(commands=[Interpolate("%(prop:JAVAC)s"), "-cp", Interpolate("%(prop:SOME_JAVA_LIB_HOME)s")))
- # ========================================================
- from buildbot.steps.trigger import Trigger
- f.addStep(Trigger(schedulerNames=['build-prep'],
- waitForFinish=True,
- updateSourceStamp=True,
- set_properties={ 'quick' : False })
- # ========================================================
- # .procmailrc
- # routes incoming mail to appropriate mailboxes
- PATH=/usr/bin:/usr/local/bin
- MAILDIR=$HOME/Mail
- LOGFILE=.procmail_log
- SHELL=/bin/sh
- :0
- *
- new
- # ========================================================
- !/usr/bin/procmail
- # ========================================================
- cvs checkout CVSROOT
- # ========================================================
- SomeModule /cvsroot/CVSROOT/buildbot_cvs_mail.py --cvsroot :ext:example.com:/cvsroot -e buildbot -P SomeModule %@{sVv@}
- # ========================================================
- driver://[username:password@]host:port/database[?args]
- # ========================================================
- from buildbot.steps.shell import ShellCommand
- from buildbot.process.properties import Interpolate
- f.addStep(ShellCommand(command=[ 'make', Interpolate('REVISION=%(prop:got_revision:-%(src::revision:-unknown)s)s')
- 'dist' ]))
- # ========================================================
- .. note:
- # ========================================================
- @properties.renderer
- def makeCommand(props):
- command = [ 'make' ]
- cpus = props.getProperty('CPUs')
- if cpus:
- command += [ '-j', str(cpus+1) ]
- else:
- command += [ '-j', '2' ]
- command += [ 'all' ]
- return command
- f.addStep(ShellCommand(command=makeCommand))
- # ========================================================
- f.addStep(ShellCommand(command=[ 'make' ], descriptionDone=FlattenList([ 'make ', [ 'done' ]]))
- # ========================================================
- class DetermineFoo(object):
- implements(IRenderable)
- def getRenderingFor(self, props)
- if props.hasProperty('bar'):
- return props['bar']
- elif props.hasProperty('baz'):
- return props['baz']
- return 'qux'
- ShellCommand(command=['echo', DetermineFoo()])
- # ========================================================
- class Now(object):
- implements(IRenderable)
- def getRenderingFor(self, props)
- return time.clock()
- ShellCommand(command=['make', Interpolate('TIME=%(kw:now)', now=Now())])
- # ========================================================
- ChoiceStringParameter(name="forced_tests",
- label = "smoke test campaign to run",
- default = default_tests,
- multiple = True,
- strict = True,
- choices = [ "test_builder1",
- "test_builder2",
- "test_builder3" ])
- ])
- # .. and later base the schedulers to trigger off this property:
- # triggers the tests depending on the property forced_test
- builder1.factory.addStep(Trigger(name="Trigger tests",
- schedulerNames=Property("forced_tests")))
- # ========================================================
- def get_compatible_builds(status, builder):
- if builder == None: # this is the case for force_build_all
- return ["cannot generate build list here"]
- # find all successful builds in builder1 and builder2
- builds = []
- for builder in ["builder1","builder2"]:
- builder_status = status.getBuilder(builder)
- for num in xrange(1,40): # 40 last builds
- b = builder_status.getBuild(-num)
- if not b:
- continue
- if b.getResults() == FAILURE:
- continue
- builds.append(builder+"/"+str(b.getNumber()))
- return builds
- # ...
- properties=[
- InheritBuildParameter(
- name="inherit",
- label="promote a build for merge",
- compatible_builds=get_compatible_builds,
- required = True),
- ])
- # ========================================================
- from buildbot.process.builder import enforceChosenSlave
- # schedulers:
- ForceScheduler(
- # ...
- properties=[
- BuildslaveChoiceParameter(),
- ]
- )
- # builders:
- BuilderConfig(
- # ...
- canStartBuild=enforceChosenSlave,
- )
- # ========================================================
- c['status'].append(html.WebStatus(..
- change_hook_dialects={ 'github' : True }))
- # ========================================================
- c['status'].append(html.WebStatus(..
- change_hook_auth=('user', 'password')))
- # ========================================================
- c['status'].append(html.WebStatus(..
- change_hook_dialects={ 'bitbucket' : True }))
- # ========================================================
- c['status'].append(html.WebStatus(..
- change_hook_auth=('user', 'password')))
- # ========================================================
- curl http://yourbuildbot/change_hook/poller?poller=https%3A%2F%2Famanda.svn.sourceforge.net%2Fsvnroot%2Famanda%2Famanda
- # ========================================================
- from buildbot.status.github import GitHubStatus
- repoOwner = Interpolate("%(prop:github_repo_owner)s"
- repoName = Interpolate("%(prop:github_repo_name)s"
- sha = Interpolate("%(src::revision)s")
- gs = GitHubStatus(token='githubAPIToken',
- repoOwner=repoOwner,
- repoName=repoName)
- sha=sha,
- startDescription='Build started.',
- endDescription='Build done.',
- )
- buildbot_bbtools = BuilderConfig(
- name='builder-name',
- slavenames=['slave1'],
- factory=BuilderFactory(),
- properties={
- "github_repo_owner": "buildbot",
- "github_repo_name": "bbtools",
- },
- )
- c['builders'].append(buildbot_bbtools)
- c['status'].append(gs)
- # ========================================================
- pythons = [ 'python2.4', 'python2.5', 'python2.6', 'python2.7',
- 'python3.2', python3.3' ]
- pytest_slaves = [ "slave%s" % n for n in range(10) ]
- for python in pythons:
- f = BuildFactory()
- f.addStep(SVN(..))
- f.addStep(ShellCommand(command=[ python, 'test.py' ]))
- c['builders'].append(BuilderConfig(
- name="test-%s" % python,
- factory=f,
- slavenames=pytest_slaves))
- # ========================================================
- class DynamicBuild(Build):
- # .. override some methods
- f = factory.BuildFactory()
- f.buildClass = DynamicBuild
- f.addStep(...)
- # ========================================================
- class Frobnify(LoggingBuildStep):
- def __init__(self,
- frob_what="frobee",
- frob_how_many=None,
- frob_how=None,
- **kwargs):
- # check
- if frob_how_many is None:
- raise TypeError("Frobnify argument how_many is required")
- # override a parent option
- kwargs['parentOpt'] = 'xyz'
- # call parent
- LoggingBuildStep.__init__(self, **kwargs)
- # set Frobnify attributes
- self.frob_what = frob_what
- self.frob_how_many = how_many
- self.frob_how = frob_how
- class FastFrobnify(Frobnify):
- def __init__(self,
- speed=5,
- **kwargs)
- Frobnify.__init__(self, **kwargs)
- self.speed = speed
- # ========================================================
- class MyBuildStep(ShellCommand):
- logfiles = @{ "nodelog": "_test/node.log" @}
- def evaluateCommand(self, cmd):
- nodelog = self.getLog("nodelog")
- if "STARTED" in nodelog.getText():
- return SUCCESS
- else:
- return FAILURE
- # ========================================================
- from buildbot.steps.shell import ShellCommand
- from buildbot.process.buildstep import LogLineObserver
- class FNURRRGHCounter(LogLineObserver):
- numTests = 0
- def outLineReceived(self, line):
- if "FNURRRGH!" in line:
- self.numTests += 1
- self.step.setProgress('tests', self.numTests)
- class Framboozle(ShellCommand):
- command = ["framboozler"]
- def __init__(self, **kwargs):
- ShellCommand.__init__(self, **kwargs) # always upcall!
- counter = FNURRRGHCounter())
- self.addLogObserver('stdio', counter)
- self.progressMetrics += ('tests',)
- # ========================================================
- git log buildbot-0.8.5..buildbot-0.8.6
- # ========================================================
- git log v0.8.6..v0.8.7
- # ========================================================
- git log v0.8.7..v0.8.8
- # ========================================================
- git log v0.8.8..master
- # ========================================================
- cd
- mkdir -p tmp/buildbot
- cd tmp/buildbot
- virtualenv --no-site-packages sandbox
- source sandbox/bin/activate
- easy_install sqlalchemy==0.7.10
- easy_install buildbot
- # ========================================================
- buildbot create-master master
- mv master/master.cfg.sample master/master.cfg
- # ========================================================
- buildbot start master
- tail -f master/twistd.log
- # ========================================================
- 2011-12-04 10:04:40-0600 [-] Starting factory <buildbot.status.web.baseweb.RotateLogSite instance at 0x2e36638>
- 2011-12-04 10:04:40-0600 [-] Setting up http.log rotating 10 files of 10000000 bytes each
- 2011-12-04 10:04:40-0600 [-] WebStatus using (/home/dustin/tmp/buildbot/master/public_html)
- 2011-12-04 10:04:40-0600 [-] removing 0 old schedulers, updating 0, and adding 1
- 2011-12-04 10:04:40-0600 [-] adding 1 new changesources, removing 0
- 2011-12-04 10:04:40-0600 [-] gitpoller: using workdir '/home/dustin/tmp/buildbot/master/gitpoller-workdir'
- 2011-12-04 10:04:40-0600 [-] gitpoller: initializing working dir from git://github.com/buildbot/pyflakes.git
- 2011-12-04 10:04:40-0600 [-] configuration update complete
- 2011-12-04 10:04:41-0600 [-] gitpoller: checking out master
- 2011-12-04 10:04:41-0600 [-] gitpoller: finished initializing working dir from git://github.com/buildbot/pyflakes.git at rev 1a4af6ec1dbb724b884ea14f439b272f30439e4d
- # ========================================================
- cd
- cd tmp/buildbot
- source sandbox/bin/activate
- # ========================================================
- easy_install buildbot-slave
- # ========================================================
- buildslave create-slave slave localhost:9989 example-slave pass
- # ========================================================
- cat master/master.cfg
- # ========================================================
- buildslave start slave
- # ========================================================
- tail -f slave/twistd.log
- # ========================================================
- 2009-07-29 20:59:18+0200 [Broker,client] message from master: attached
- 2009-07-29 20:59:18+0200 [Broker,client] SlaveBuilder.remote_print(buildbot-full): message from master: attached
- 2009-07-29 20:59:18+0200 [Broker,client] sending application-level keepalives every 600 seconds
- # ========================================================
- 2011-03-13 18:46:58-0700 [Broker,1,127.0.0.1] slave 'example-slave' attaching from IPv4Address(TCP, '127.0.0.1', 41306)
- 2011-03-13 18:46:58-0700 [Broker,1,127.0.0.1] Got slaveinfo from 'example-slave'
- 2011-03-13 18:46:58-0700 [Broker,1,127.0.0.1] bot attached
- 2011-03-13 18:46:58-0700 [Broker,1,127.0.0.1] Buildslave example-slave attached to runtests
- # ========================================================
- $ make clean # clean remnants of previous builds
- ...
- $ svn update
- ...
- $ make all
- ...
- $ make packages
- ...
- # optional but included in the example: copy packages to some central machine
- $ scp packages/*.rpm packages/*.deb packages/*.tgz someuser@somehost:/repository
- ...
- # ========================================================
- trunkchanged = SingleBranchScheduler(name = "trunkchanged",
- change_filter = filter.ChangeFilter(branch = None),
- ...
- # ========================================================
- trunkchanged = SingleBranchScheduler(name = "trunkchanged",
- change_filter = filter.ChangeFilter(project = "coolproject", branch = None),
- ...
- # ========================================================
- cd
- cd tmp/buildbot
- source sandbox/bin/activate
- $EDITOR master/master.cfg
- # ========================================================
- buildbot reconfig master
- # ========================================================
- 2011-12-04 10:11:09-0600 [-] loading configuration from /home/dustin/tmp/buildbot/master/master.cfg
- 2011-12-04 10:11:09-0600 [-] configuration update started
- 2011-12-04 10:11:09-0600 [-] builder runtests is unchanged
- 2011-12-04 10:11:09-0600 [-] removing IStatusReceiver <WebStatus on port tcp:8010 at 0x2aee368>
- 2011-12-04 10:11:09-0600 [-] (TCP Port 8010 Closed)
- 2011-12-04 10:11:09-0600 [-] Stopping factory <buildbot.status.web.baseweb.RotateLogSite instance at 0x2e36638>
- 2011-12-04 10:11:09-0600 [-] adding IStatusReceiver <WebStatus on port tcp:8010 at 0x2c2d950>
- 2011-12-04 10:11:09-0600 [-] RotateLogSite starting on 8010
- 2011-12-04 10:11:09-0600 [-] Starting factory <buildbot.status.web.baseweb.RotateLogSite instance at 0x2e36e18>
- 2011-12-04 10:11:09-0600 [-] Setting up http.log rotating 10 files of 10000000 bytes each
- 2011-12-04 10:11:09-0600 [-] WebStatus using (/home/dustin/tmp/buildbot/master/public_html)
- 2011-12-04 10:11:09-0600 [-] removing 0 old schedulers, updating 0, and adding 0
- 2011-12-04 10:11:09-0600 [-] adding 1 new changesources, removing 1
- 2011-12-04 10:11:09-0600 [-] gitpoller: using workdir '/home/dustin/tmp/buildbot/master/gitpoller-workdir'
- 2011-12-04 10:11:09-0600 [-] GitPoller repository already exists
- 2011-12-04 10:11:09-0600 [-] configuration update complete
- Reconfiguration appears to have completed successfully.
- # ========================================================
- c[title'] = "Pyflakes"
- c['titleURL'] = "http://divmod.org/trac/wiki/DivmodPyflakes"
- # ========================================================
- buildbot reconfig master
- # ========================================================
- 2011-12-04 10:12:28-0600 [-] loading configuration from /home/dustin/tmp/buildbot/master/master.cfg
- 2011-12-04 10:12:28-0600 [-] configuration update started
- 2011-12-04 10:12:28-0600 [-] error while parsing config file
- 2011-12-04 10:12:28-0600 [-] Unhandled Error
- Traceback (most recent call last):
- File "/home/dustin/tmp/buildbot/sandbox/lib/python2.7/site-packages/buildbot-0.8.5-py2.7.egg/buildbot/master.py", line 197, in loadTheConfigFile
- d = self.loadConfig(f)
- File "/home/dustin/tmp/buildbot/sandbox/lib/python2.7/site-packages/buildbot-0.8.5-py2.7.egg/buildbot/master.py", line 579, in loadConfig
- d.addCallback(do_load)
- File "/home/dustin/tmp/buildbot/sandbox/lib/python2.7/site-packages/Twisted-11.1.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 298, in addCallback
- callbackKeywords=kw)
- File "/home/dustin/tmp/buildbot/sandbox/lib/python2.7/site-packages/Twisted-11.1.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 287, in addCallbacks
- self._runCallbacks()
- --- <exception caught here> ---
- File "/home/dustin/tmp/buildbot/sandbox/lib/python2.7/site-packages/Twisted-11.1.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 545, in _runCallbacks
- current.result = callback(current.result, *args, **kw)
- File "/home/dustin/tmp/buildbot/sandbox/lib/python2.7/site-packages/buildbot-0.8.5-py2.7.egg/buildbot/master.py", line 226, in do_load
- exec f in localDict
- exceptions.SyntaxError: EOL while scanning string literal (master.cfg, line 17)
- Never saw reconfiguration finish.
- # ========================================================
- grep -i irc master/twistd.log
- # ========================================================
- 2009-08-01 15:35:20+0200 [-] adding IStatusReceiver <buildbot.status.words.IRC instance at 0x300d290>
- # ========================================================
- bbtest: commands
- # ========================================================
- bbtest: help notify
- # ========================================================
- bbtest: notify on started
- bbtest: notify on finished
- bbtest: notify on failure
- # ========================================================
- <@lsblakk> bbtest: notify on started
- <bbtest> The following events are being notified: ['started']
- <@lsblakk> bbtest: notify on finished
- <bbtest> The following events are being notified: ['started', 'finished']
- <@lsblakk> bbtest: notify on failure
- <bbtest> The following events are being notified: ['started', 'failure', 'finished']
- # ========================================================
- < bbtest> build #1 of runtests started, including []
- < bbtest> build #1 of runtests is complete: Success [build successful] Build details are at http://localhost:8010/builders/runtests/builds/1
- # ========================================================
- bbtest: force build runtests test build
- # ========================================================
- <@lsblakk> bbtest: force build runtests test build
- < bbtest> build #2 of runtests started, including []
- < bbtest> build forced [ETA 0 seconds]
- < bbtest> I'll give a shout when the build finishes
- < bbtest> build #2 of runtests is complete: Success [build successful] Build details are at http://localhost:8010/builders/runtests/builds/2
- # ========================================================
- cd
- cd tmp/buildbot
- source sandbox/bin/activate
- easy_install pycrypto
- easy_install pyasn1
- # ========================================================
- ssh -p1234 admin@127.0.0.1
- # enter passwd at prompt
- # ========================================================
- exceptions.TypeError: argument 2 must be long, not int
- # ========================================================
- pip install pyasn1-0.0.13b
- # ========================================================
- git clone git://github.com/buildbot/pyflakes.git pyflakes-git
- cd pyflakes-git/pyflakes
- $EDITOR checker.py
- # change "traceTree = False" on line 185 to "traceTree = True"
- # ========================================================
- source ~/tmp/buildbot/sandbox/bin/activate
- buildbot try --connect=pb --master=127.0.0.1:5555 --username=sampleuser --passwd=samplepass --vc=git
- # ========================================================
- cd
- mkdir -p tmp/buildbot
- cd tmp/buildbot
- virtualenv --no-site-packages sandbox
- source sandbox/bin/activate
- easy_install sqlalchemy==0.7.10
- easy_install buildbot
- # ========================================================
- buildbot create-master master
- mv master/master.cfg.sample master/master.cfg
- # ========================================================
- buildbot start master
- tail -f master/twistd.log
- # ========================================================
- 2011-12-04 10:04:40-0600 [-] Starting factory <buildbot.status.web.baseweb.RotateLogSite instance at 0x2e36638>
- 2011-12-04 10:04:40-0600 [-] Setting up http.log rotating 10 files of 10000000 bytes each
- 2011-12-04 10:04:40-0600 [-] WebStatus using (/home/dustin/tmp/buildbot/master/public_html)
- 2011-12-04 10:04:40-0600 [-] removing 0 old schedulers, updating 0, and adding 1
- 2011-12-04 10:04:40-0600 [-] adding 1 new changesources, removing 0
- 2011-12-04 10:04:40-0600 [-] gitpoller: using workdir '/home/dustin/tmp/buildbot/master/gitpoller-workdir'
- 2011-12-04 10:04:40-0600 [-] gitpoller: initializing working dir from git://github.com/buildbot/pyflakes.git
- 2011-12-04 10:04:40-0600 [-] configuration update complete
- 2011-12-04 10:04:41-0600 [-] gitpoller: checking out master
- 2011-12-04 10:04:41-0600 [-] gitpoller: finished initializing working dir from git://github.com/buildbot/pyflakes.git at rev 1a4af6ec1dbb724b884ea14f439b272f30439e4d
- # ========================================================
- cd
- cd tmp/buildbot
- source sandbox/bin/activate
- # ========================================================
- easy_install buildbot-slave
- # ========================================================
- buildslave create-slave slave localhost:9989 example-slave pass
- # ========================================================
- cat master/master.cfg
- # ========================================================
- buildslave start slave
- # ========================================================
- tail -f slave/twistd.log
- # ========================================================
- 2009-07-29 20:59:18+0200 [Broker,client] message from master: attached
- 2009-07-29 20:59:18+0200 [Broker,client] SlaveBuilder.remote_print(buildbot-full): message from master: attached
- 2009-07-29 20:59:18+0200 [Broker,client] sending application-level keepalives every 600 seconds
- # ========================================================
- 2011-03-13 18:46:58-0700 [Broker,1,127.0.0.1] slave 'example-slave' attaching from IPv4Address(TCP, '127.0.0.1', 41306)
- 2011-03-13 18:46:58-0700 [Broker,1,127.0.0.1] Got slaveinfo from 'example-slave'
- 2011-03-13 18:46:58-0700 [Broker,1,127.0.0.1] bot attached
- 2011-03-13 18:46:58-0700 [Broker,1,127.0.0.1] Buildslave example-slave attached to runtests
- # ========================================================
- cd
- cd tmp/buildbot
- source sandbox/bin/activate
- $EDITOR master/master.cfg
- # ========================================================
- buildbot reconfig master
- # ========================================================
- 2011-12-04 10:11:09-0600 [-] loading configuration from /home/dustin/tmp/buildbot/master/master.cfg
- 2011-12-04 10:11:09-0600 [-] configuration update started
- 2011-12-04 10:11:09-0600 [-] builder runtests is unchanged
- 2011-12-04 10:11:09-0600 [-] removing IStatusReceiver <WebStatus on port tcp:8010 at 0x2aee368>
- 2011-12-04 10:11:09-0600 [-] (TCP Port 8010 Closed)
- 2011-12-04 10:11:09-0600 [-] Stopping factory <buildbot.status.web.baseweb.RotateLogSite instance at 0x2e36638>
- 2011-12-04 10:11:09-0600 [-] adding IStatusReceiver <WebStatus on port tcp:8010 at 0x2c2d950>
- 2011-12-04 10:11:09-0600 [-] RotateLogSite starting on 8010
- 2011-12-04 10:11:09-0600 [-] Starting factory <buildbot.status.web.baseweb.RotateLogSite instance at 0x2e36e18>
- 2011-12-04 10:11:09-0600 [-] Setting up http.log rotating 10 files of 10000000 bytes each
- 2011-12-04 10:11:09-0600 [-] WebStatus using (/home/dustin/tmp/buildbot/master/public_html)
- 2011-12-04 10:11:09-0600 [-] removing 0 old schedulers, updating 0, and adding 0
- 2011-12-04 10:11:09-0600 [-] adding 1 new changesources, removing 1
- 2011-12-04 10:11:09-0600 [-] gitpoller: using workdir '/home/dustin/tmp/buildbot/master/gitpoller-workdir'
- 2011-12-04 10:11:09-0600 [-] GitPoller repository already exists
- 2011-12-04 10:11:09-0600 [-] configuration update complete
- Reconfiguration appears to have completed successfully.
- # ========================================================
- c[title'] = "Pyflakes"
- c['titleURL'] = "http://divmod.org/trac/wiki/DivmodPyflakes"
- # ========================================================
- buildbot reconfig master
- # ========================================================
- 2011-12-04 10:12:28-0600 [-] loading configuration from /home/dustin/tmp/buildbot/master/master.cfg
- 2011-12-04 10:12:28-0600 [-] configuration update started
- 2011-12-04 10:12:28-0600 [-] error while parsing config file
- 2011-12-04 10:12:28-0600 [-] Unhandled Error
- Traceback (most recent call last):
- File "/home/dustin/tmp/buildbot/sandbox/lib/python2.7/site-packages/buildbot-0.8.5-py2.7.egg/buildbot/master.py", line 197, in loadTheConfigFile
- d = self.loadConfig(f)
- File "/home/dustin/tmp/buildbot/sandbox/lib/python2.7/site-packages/buildbot-0.8.5-py2.7.egg/buildbot/master.py", line 579, in loadConfig
- d.addCallback(do_load)
- File "/home/dustin/tmp/buildbot/sandbox/lib/python2.7/site-packages/Twisted-11.1.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 298, in addCallback
- callbackKeywords=kw)
- File "/home/dustin/tmp/buildbot/sandbox/lib/python2.7/site-packages/Twisted-11.1.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 287, in addCallbacks
- self._runCallbacks()
- --- <exception caught here> ---
- File "/home/dustin/tmp/buildbot/sandbox/lib/python2.7/site-packages/Twisted-11.1.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 545, in _runCallbacks
- current.result = callback(current.result, *args, **kw)
- File "/home/dustin/tmp/buildbot/sandbox/lib/python2.7/site-packages/buildbot-0.8.5-py2.7.egg/buildbot/master.py", line 226, in do_load
- exec f in localDict
- exceptions.SyntaxError: EOL while scanning string literal (master.cfg, line 17)
- Never saw reconfiguration finish.
- # ========================================================
- grep -i irc master/twistd.log
- # ========================================================
- 2009-08-01 15:35:20+0200 [-] adding IStatusReceiver <buildbot.status.words.IRC instance at 0x300d290>
- # ========================================================
- bbtest: commands
- # ========================================================
- bbtest: help notify
- # ========================================================
- bbtest: notify on started
- bbtest: notify on finished
- bbtest: notify on failure
- # ========================================================
- <@lsblakk> bbtest: notify on started
- <bbtest> The following events are being notified: ['started']
- <@lsblakk> bbtest: notify on finished
- <bbtest> The following events are being notified: ['started', 'finished']
- <@lsblakk> bbtest: notify on failure
- <bbtest> The following events are being notified: ['started', 'failure', 'finished']
- # ========================================================
- < bbtest> build #1 of runtests started, including []
- < bbtest> build #1 of runtests is complete: Success [build successful] Build details are at http://localhost:8010/builders/runtests/builds/1
- # ========================================================
- bbtest: force build runtests test build
- # ========================================================
- <@lsblakk> bbtest: force build runtests test build
- < bbtest> build #2 of runtests started, including []
- < bbtest> build forced [ETA 0 seconds]
- < bbtest> I'll give a shout when the build finishes
- < bbtest> build #2 of runtests is complete: Success [build successful] Build details are at http://localhost:8010/builders/runtests/builds/2
- # ========================================================
- cd
- cd tmp/buildbot
- source sandbox/bin/activate
- easy_install pycrypto
- easy_install pyasn1
- # ========================================================
- ssh -p1234 admin@127.0.0.1
- # enter passwd at prompt
- # ========================================================
- exceptions.TypeError: argument 2 must be long, not int
- # ========================================================
- pip install pyasn1-0.0.13b
- # ========================================================
- git clone git://github.com/buildbot/pyflakes.git pyflakes-git
- cd pyflakes-git/pyflakes
- $EDITOR checker.py
- # change "traceTree = False" on line 185 to "traceTree = True"
- # ========================================================
- source ~/tmp/buildbot/sandbox/bin/activate
- buildbot try --connect=pb --master=127.0.0.1:5555 --username=sampleuser --passwd=samplepass --vc=git
- # ========================================================
- $ make clean # clean remnants of previous builds
- ...
- $ svn update
- ...
- $ make all
- ...
- $ make packages
- ...
- # optional but included in the example: copy packages to some central machine
- $ scp packages/*.rpm packages/*.deb packages/*.tgz someuser@somehost:/repository
- ...
- # ========================================================
- trunkchanged = SingleBranchScheduler(name = "trunkchanged",
- change_filter = filter.ChangeFilter(branch = None),
- ...
- # ========================================================
- trunkchanged = SingleBranchScheduler(name = "trunkchanged",
- change_filter = filter.ChangeFilter(project = "coolproject", branch = None),
- ...
- # ========================================================
- driver://[username:password@]host:port/database[?args]
- # ========================================================
- # .procmailrc
- # routes incoming mail to appropriate mailboxes
- PATH=/usr/bin:/usr/local/bin
- MAILDIR=$HOME/Mail
- LOGFILE=.procmail_log
- SHELL=/bin/sh
- :0
- *
- new
- # ========================================================
- !/usr/bin/procmail
- # ========================================================
- cvs checkout CVSROOT
- # ========================================================
- SomeModule /cvsroot/CVSROOT/buildbot_cvs_mail.py --cvsroot :ext:example.com:/cvsroot -e buildbot -P SomeModule %@{sVv@}
- # ========================================================
- ChoiceStringParameter(name="forced_tests",
- label = "smoke test campaign to run",
- default = default_tests,
- multiple = True,
- strict = True,
- choices = [ "test_builder1",
- "test_builder2",
- "test_builder3" ])
- ])
- # .. and later base the schedulers to trigger off this property:
- # triggers the tests depending on the property forced_test
- builder1.factory.addStep(Trigger(name="Trigger tests",
- schedulerNames=Property("forced_tests")))
- # ========================================================
- def get_compatible_builds(status, builder):
- if builder == None: # this is the case for force_build_all
- return ["cannot generate build list here"]
- # find all successful builds in builder1 and builder2
- builds = []
- for builder in ["builder1","builder2"]:
- builder_status = status.getBuilder(builder)
- for num in xrange(1,40): # 40 last builds
- b = builder_status.getBuild(-num)
- if not b:
- continue
- if b.getResults() == FAILURE:
- continue
- builds.append(builder+"/"+str(b.getNumber()))
- return builds
- # ...
- properties=[
- InheritBuildParameter(
- name="inherit",
- label="promote a build for merge",
- compatible_builds=get_compatible_builds,
- required = True),
- ])
- # ========================================================
- from buildbot.process.builder import enforceChosenSlave
- # schedulers:
- ForceScheduler(
- # ...
- properties=[
- BuildslaveChoiceParameter(),
- ]
- )
- # builders:
- BuilderConfig(
- # ...
- canStartBuild=enforceChosenSlave,
- )
- # ========================================================
- def pickNextBuild(builder, requests):
- # ...
- c['builders'] = [
- BuilderConfig(name='test', factory=f,
- nextBuild=pickNextBuild,
- slavenames=['slave1', 'slave2', 'slave3', 'slave4']),
- ]
- # ========================================================
- from buildbot.steps.shell import ShellCommand
- from buildbot.process.properties import Interpolate
- f.addStep(ShellCommand(command=[ 'make', Interpolate('REVISION=%(prop:got_revision:-%(src::revision:-unknown)s)s')
- 'dist' ]))
- # ========================================================
- .. note:
- # ========================================================
- @properties.renderer
- def makeCommand(props):
- command = [ 'make' ]
- cpus = props.getProperty('CPUs')
- if cpus:
- command += [ '-j', str(cpus+1) ]
- else:
- command += [ '-j', '2' ]
- command += [ 'all' ]
- return command
- f.addStep(ShellCommand(command=makeCommand))
- # ========================================================
- f.addStep(ShellCommand(command=[ 'make' ], descriptionDone=FlattenList([ 'make ', [ 'done' ]]))
- # ========================================================
- class DetermineFoo(object):
- implements(IRenderable)
- def getRenderingFor(self, props)
- if props.hasProperty('bar'):
- return props['bar']
- elif props.hasProperty('baz'):
- return props['baz']
- return 'qux'
- ShellCommand(command=['echo', DetermineFoo()])
- # ========================================================
- class Now(object):
- implements(IRenderable)
- def getRenderingFor(self, props)
- return time.clock()
- ShellCommand(command=['make', Interpolate('TIME=%(kw:now)', now=Now())])
- # ========================================================
- //depot/branch/mybranch/... //<p4client>/...
- -//depot/branch/mybranch/notthisdir/... //<p4client>/notthisdir/...
- # ========================================================
- .. directoryEnterPattern = "make.*: Entering directory [\"`'](.*)['`\"]"
- .. directoryLeavePattern = "make.*: Leaving directory"
- # ========================================================
- from buildbot.steps.slave import SetPropertiesFromEnv
- from buildbot.steps.shell import Compile
- f.addStep(SetPropertiesFromEnv(variables=["SOME_JAVA_LIB_HOME", "JAVAC"]))
- f.addStep(Compile(commands=[Interpolate("%(prop:JAVAC)s"), "-cp", Interpolate("%(prop:SOME_JAVA_LIB_HOME)s")))
- # ========================================================
- from buildbot.steps.trigger import Trigger
- f.addStep(Trigger(schedulerNames=['build-prep'],
- waitForFinish=True,
- updateSourceStamp=True,
- set_properties={ 'quick' : False })
- # ========================================================
- c['status'].append(html.WebStatus(..
- change_hook_dialects={ 'github' : True }))
- # ========================================================
- c['status'].append(html.WebStatus(..
- change_hook_auth=('user', 'password')))
- # ========================================================
- c['status'].append(html.WebStatus(..
- change_hook_dialects={ 'bitbucket' : True }))
- # ========================================================
- c['status'].append(html.WebStatus(..
- change_hook_auth=('user', 'password')))
- # ========================================================
- curl http://yourbuildbot/change_hook/poller?poller=https%3A%2F%2Famanda.svn.sourceforge.net%2Fsvnroot%2Famanda%2Famanda
- # ========================================================
- from buildbot.status.github import GitHubStatus
- repoOwner = Interpolate("%(prop:github_repo_owner)s"
- repoName = Interpolate("%(prop:github_repo_name)s"
- sha = Interpolate("%(src::revision)s")
- gs = GitHubStatus(token='githubAPIToken',
- repoOwner=repoOwner,
- repoName=repoName)
- sha=sha,
- startDescription='Build started.',
- endDescription='Build done.',
- )
- buildbot_bbtools = BuilderConfig(
- name='builder-name',
- slavenames=['slave1'],
- factory=BuilderFactory(),
- properties={
- "github_repo_owner": "buildbot",
- "github_repo_name": "bbtools",
- },
- )
- c['builders'].append(buildbot_bbtools)
- c['status'].append(gs)
- # ========================================================
- pythons = [ 'python2.4', 'python2.5', 'python2.6', 'python2.7',
- 'python3.2', python3.3' ]
- pytest_slaves = [ "slave%s" % n for n in range(10) ]
- for python in pythons:
- f = BuildFactory()
- f.addStep(SVN(..))
- f.addStep(ShellCommand(command=[ python, 'test.py' ]))
- c['builders'].append(BuilderConfig(
- name="test-%s" % python,
- factory=f,
- slavenames=pytest_slaves))
- # ========================================================
- class DynamicBuild(Build):
- # .. override some methods
- f = factory.BuildFactory()
- f.buildClass = DynamicBuild
- f.addStep(...)
- # ========================================================
- class Frobnify(LoggingBuildStep):
- def __init__(self,
- frob_what="frobee",
- frob_how_many=None,
- frob_how=None,
- **kwargs):
- # check
- if frob_how_many is None:
- raise TypeError("Frobnify argument how_many is required")
- # override a parent option
- kwargs['parentOpt'] = 'xyz'
- # call parent
- LoggingBuildStep.__init__(self, **kwargs)
- # set Frobnify attributes
- self.frob_what = frob_what
- self.frob_how_many = how_many
- self.frob_how = frob_how
- class FastFrobnify(Frobnify):
- def __init__(self,
- speed=5,
- **kwargs)
- Frobnify.__init__(self, **kwargs)
- self.speed = speed
- # ========================================================
- class MyBuildStep(ShellCommand):
- logfiles = @{ "nodelog": "_test/node.log" @}
- def evaluateCommand(self, cmd):
- nodelog = self.getLog("nodelog")
- if "STARTED" in nodelog.getText():
- return SUCCESS
- else:
- return FAILURE
- # ========================================================
- from buildbot.steps.shell import ShellCommand
- from buildbot.process.buildstep import LogLineObserver
- class FNURRRGHCounter(LogLineObserver):
- numTests = 0
- def outLineReceived(self, line):
- if "FNURRRGH!" in line:
- self.numTests += 1
- self.step.setProgress('tests', self.numTests)
- class Framboozle(ShellCommand):
- command = ["framboozler"]
- def __init__(self, **kwargs):
- ShellCommand.__init__(self, **kwargs) # always upcall!
- counter = FNURRRGHCounter())
- self.addLogObserver('stdio', counter)
- self.progressMetrics += ('tests',)
- # ========================================================
- def myMethod(self):
- d = ...
- d.addCallback(self._myMethod_2) # BAD!
- def _myMethod_2(self, res): # BAD!
- # ...
- # ========================================================
- def getRevInfo(revname):
- results = {}
- finished = dict(rev_parse=False, log=False)
- rev_parse_d = utils.getProcessOutput(git, [ 'rev-parse', revname ])
- def parse_rev_parse(res):
- return res.strip()
- rev_parse_d.addCallback(parse_rev_parse)
- log_d = utils.getProcessOutput(git, [ 'log', '-1', '--format=%s%n%b', results['rev'] ]))
- def parse_log(res):
- return res.strip()
- log_d.addCallback(parse_log)
- d = defer.DeferredList([rev_parse_d, log_d], consumeErrors=1, fireOnFirstErrback=1)
- def handle_results(results):
- return dict(rev=results[0][1], log=results[1][1])
- d.addCallback(handle_results)
- return d
- # ========================================================
- def start(self):
- cmd = RemoteShellCommand(..)
- self.startCommand(cmd, warnings)
- # ========================================================
- git log v0.8.8..master
- # ========================================================
- git log v0.8.7..v0.8.8
- # ========================================================
- git log v0.8.6..v0.8.7
- # ========================================================
- git log buildbot-0.8.5..buildbot-0.8.6/bin/sh: 1: [[: not found
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement