buildbot的master.cfg 檔案分析

來源:互聯網
上載者:User
盡量保持和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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.