我正在尝试将 buildbot 用于 CI 目的。我已经设置了一个 buildmaster 和 buildslave。而且,它们都是相连的。(我在下面附上我的 master.cfg)
我有以下问题:
a) 我可以在 Waterfall 页面上看到提交的更改,这意味着 SVNPoller 工作正常。但是,没有任何更改正在构建。我得到一个“?” 在 buildbot 页面上。
b) 当我尝试从 http://localhost:8010/builders 进行强制构建时,我在日志中收到错误消息:[HTTPChannel,1,10.0.0.58] ..but not authorized
c = BuildmasterConfig = {}
from buildbot.buildslave import BuildSlave
c['slaves'] = [BuildSlave("example-slave", "pass")]
c['slavePortnum'] = 9989
from buildbot.changes.svnpoller import SVNPoller
c['change_source'] = []
c['change_source'].append(SVNPoller(
'file:///my/repo/path/trunk',
pollinterval=300))
from buildbot.schedulers.basic import SingleBranchScheduler
from buildbot.schedulers.forcesched import ForceScheduler
from buildbot.changes import filter
c['schedulers'] = []
c['schedulers'].append(SingleBranchScheduler(
name="all",
change_filter=filter.ChangeFilter(branch='trunk'),
treeStableTimer=None,
builderNames=["runtests"]))
c['schedulers'].append(ForceScheduler(
name="force",
builderNames=["runtests"]))
from buildbot.process.factory import BuildFactory
from buildbot.steps.source import Git
from buildbot.steps.source import SVN
from buildbot.steps.shell import ShellCommand
from buildbot.steps import source, shell
from buildbot.process import factory
f = factory.BuildFactory()
f.addStep(source.SVN(svnurl="file:///my/repo/path/trunk/", mode="copy"))
f.addStep(shell.ShellCommand(command=["cmake", "."]))
f.addStep(shell.ShellCommand(command=["make", "all"]))
from buildbot.config import BuilderConfig
c['builders'] = []
c['builders'].append(
BuilderConfig(name="runtests",
slavenames=["example-slave"],
factory=f))
c['status'] = []
from buildbot.status import html
from buildbot.status.web import authz, auth
authz_cfg=authz.Authz(
auth=auth.BasicAuth([("userid","password")]),
gracefulShutdown = False,
forceBuild = 'auth', # use this to test your slave once it is set up
forceAllBuilds = True,
pingBuilder = False,
stopBuild = False,
stopAllBuilds = False,
cancelPendingBuild = False,
)
c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
c['title'] = "My Project"
c['titleURL'] = "http://my/url"
c['buildbotURL'] = "http://localhost:8010/"
c['db'] = {
'db_url' : "sqlite:///state.sqlite",
}