Support for multiple repositories using Buildbot

梦想的初衷 提交于 2019-12-04 19:19:28

问题


Currently Buildbot does not support multiple repositories. If one desires to have this then separate instances of Buildbot need to be run.

Still I'm curious if anyone has come up with a creative workaround to get this feature working anyway.


回答1:


Update

This answer received a few downvotes recently, please note that this answer applies to the releases of buildbot that were published/used around the end of 2012/beginning of 2013 and may not be applicable for future versions.

Original Answer

As @Macke said, buildbot (>= 0.8.x) supports multiple projects/repositories. This is done with configuration like the following:

# Set configuration to watch the Git repository for possible
# changes. When a change does occur the schedulers will be
# notified with the project data (TestProj).
c['change_source'] = []
c['change_source'].append(
        GitPoller( 
                repourl ='git://github.com/SO/my_test_project.git',
                project = 'TestProj',  
                branch  = 'master',
                workdir = '/home/buildmaster/repos/TestProj'
        )
)

# Set the schedule to run on each change, but only for the project
# specified above via the project information.
c['schedulers'] = []
c['schedulers'].append(
        SingleBranchScheduler(
                name = "TestProj-master",
                builderNames = ['TestProj-master-builder'],
                change_filter = ChangeFilter(
                        project = 'TestProj',
                        branch  = 'master'
                )
        )
)

You can see that the project parameter in the change source is then used again in the scheduler's change_filter property to ensure that the scheduler only responds to that particular change source. This allows you to configure multiple change sources and multiple schedulers responding to explicitly chosen change sources.




回答2:


Since the 0.8.7p1 release, buildbot supports multiple codebases




回答3:


Indeed i don't get the reason why you say that it does not support multiple repositories....you can create a poller for each repository and multiple schedulers that ping the different pollers and get the builds for many different repositories (either on the same machine where the master runs, or you can have a dedicated slave on a different box).

You want to avoid to have multiple instances, but for example, master and slave coexist on the same machine even if is a pain to start and stop them in order, otherwise you get conflict errors :)




回答4:


|> Currently Buildbot does not support multiple repositories.

I don't really understand the question.. sorry. Do you mean that you have to run multiple master servers? It is actually advised by the buildbot devs to do so, but the contrary works for me: you can have in the same master.cfg multiple slaves (columns in the waterfall) and for each or them a BuildFactory with different first steps of the type: Git(repourl=...) and/or Mercurial(repourl=...) etc.

Each will clone/pull from different repositories and you can even add some more checkouts that are needed in subsequent steps (using maven or directly your scm client). The only issue with having a unique master.cfg file is that all builders will have only one method for getting notifications of changes; we have for example PBChangeSource() (master is notified by remote code, it has nothing to do). If for instance you have an SCM with good PBChangeSource support (e.g., svn, hg, git) and an other ones with bad support (e.g., MKS) then you should have two master server instances in order to cope with that.

Hope it'll help.



来源:https://stackoverflow.com/questions/2795386/support-for-multiple-repositories-using-buildbot

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!