buildbot的master.cfg 文件分析

尽量保持和buildbot create-master master 时所创建的内容一致, 分析关键点
更多详尽的请阅读官网的手册 http://buildbot.net/repos/release/docs/buildbot.html
jimi@debian:~/buildbot/master$ cat master.cfg

# -*- python -*-
# ex: set syntax=python:                                  # 设置Vi的高亮方式

c = BuildmasterConfig = {}

from buildbot.buildslave import BuildSlave
c['slaves'] = [BuildSlave(" bot1name", " bot1passwd")]      # 创建slave所需的名字和密码

# to limit to two concurrent builds on a slave, use
# c['slaves'] = [BuildSlave("bot1name", "bot1passwd", max_builds=2)] # 限制当前slave的在线个数

c['slavePortnum'] = 9989                 # slave与master通信的端口号,可以改变

####### CHANGESOURCES

# the 'change_source' setting tells the buildmaster how it should find out
# about source code changes. Any class which implements IChangeSource can be
# put here: there are several in buildbot/changes/*.py to choose from.

#监控源码改变的方式
#from buildbot.changes.pb import PBChangeSource # 注释掉
#c['change_source'] = PBChangeSource()                 # 注释掉
#我采用SVN的方式
#svnpoller.py 脚本会检测svn服务器上源码的改变
from buildbot.changes.svnpoller import SVNPoller  
c['change_source'] = SVNPoller("svn://192.168.1.100/svn/pro", #工程地址
                    svnuser='', svnpasswd='',   #用户和密码,当时设置为空
                    pollinterval=5)                      #每各5秒查询一次,默认10分钟

####### SCHEDULERS
from buildbot.scheduler import Scheduler
c['schedulers'] = []
c['schedulers'].append(Scheduler(name="all", branch=None,
                                 treeStableTimer=5, #表示在进行代码构建之前,代码保持不变的必要时间。实际上就是代码上传的缓冲时间,过了这个时间,客户端才进行代码构建。
                                 builderNames=["buildbot-full"]))     #网页中显示的名字
####### BUILDERS

#cvsroot = ":pserver:anonymous@cvs.sourceforge.net:/cvsroot/buildbot" # 注释掉
#cvsmodule = "buildbot" # 注释掉

from buildbot.process import factory
from buildbot.steps.source import SVN
from buildbot.steps.shell import Compile
from buildbot.steps.python_twisted import Trial
#f1 = factory.BuildFactory() # 注释掉
#f1.addStep(CVS(cvsroot=cvsroot, cvsmodule=cvsmodule, login="", mode="copy")) # 注释掉
#f1.addStep(Compile(command=["python", "./setup.py", "build"])) # 注释掉
#f1.addStep(Trial(testpath=".")) # 注释掉

f1 = factory.BuildFactory()
f1.addStep(SVN(mode='update', baseURL='svn://192.168.1.100/svn/pro', #工程地址
    defaultBranch=''))       # ?
f1.addStep(Compile(command=["make"]))
#如何想执行的命令都在addStep添加,但命令要存在于slave的path中

b1 = {'name': "buildbot-full", #网页中显示的名字
      'slavename': "bot1name", #slave的名字,没有忘记吧
      'builddir': "full",                   #在master/slave都要生成的目录名字
      'factory': f1,
      }

c['builders'] = [b1]


####### STATUS TARGETS
c['status'] = []
# 结果提交方式,
from buildbot.status import html
c['status'].append(html.WebStatus(http_port= 8010))

####### PROJECT IDENTITY
c['projectName'] = "Buildbot"         #工程名字
c['projectURL'] = "http://buildbot.sourceforge.net/" #工程主页

c['buildbotURL'] = "http://localhost:8010/"   #浏览结果的网址


参考
http://blog.chinaunix.net/u2/68938/showart_1076484.html
http://buildbot.net/repos/release/docs/buildbot.html
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值