4

使用されているbuildbotのバージョンは次のとおりです。

$ buildbot --version
Buildbotバージョン:0.8.3p1
ツイストバージョン:10.1.0

Checkconfig、エラーが発生します:

$ buildbot checkconfig
/usr/lib/python2.6/dist-packages/twisted/mail/smtp.py:10:非推奨警告:MimeWriterモジュールは非推奨です。代わりにメールパッケージを使用してください
  MimeWriter、tempfile、rfc822をインポートします
トレースバック(最後の最後の呼び出し):
  doCheckConfigのファイル"/usr/local/lib/python2.6/dist-packages/buildbot-0.8.3p1-py2.6.egg/buildbot/scripts/runner.py"、行1071
    ConfigLoader(configFileName = configFileName)
  ファイル"/usr/local/lib/python2.6/dist-packages/buildbot-0.8.3p1-py2.6.egg/buildbot/scripts/checkconfig.py"、46行目、__ init__
    self.loadConfig(configFile、check_synchronously_only = True)
  loadConfigのファイル"/usr/local/lib/python2.6/dist-packages/buildbot-0.8.3p1-py2.6.egg/buildbot/master.py"、行883
    %(b ['name']、n))
ValueError:ビルダーruntestsは未定義のスレーブの例を使用します-スレーブ
$

これが私が見た一例です:

http://agiletesting.blogspot.com/2006/02/continuous-integration-with-buildbot.html

4

2 に答える 2

4

これは以下に関係します:

Buildbot version: 0.8.8
Twisted version: 13.2.0

単純なhgリポジトリで動作させるにはいくつかの深刻な問題がありましたが、同じプロジェクトはgitと適切な関数で正常に動作しました。だからここにあります。

master.cfgのリポジトリを扱う場所は3つあります。changesources、scheduler、buildersで、Mercurial固有の機能を使用するchangesourcesとbuilderのみです。

changesourcesセクション

from buildbot.changes.hgpoller import HgPoller
therepo=HgPoller(repourl="/home/user/test/my_project/",
                           branch='default',
                           pollInterval=30,
                           workdir='myrepo')

c['change_source'] = []
c['change_source'].append(therepo)

ここではHgPoller、の代わりにを使用しPBChangeSourceます。後者はより洗練されていますが、より多くの構成手順が必要です(ポートとさらに別のユーザー名とパスワードを提供します)。

repourlhgリポジトリのルートを指している必要があります。「hgpull」または「hgclone」に使用できる任意のURLを使用できます。この例にはローカルリポジトリが含まれていますが、サーバー上にある可能性があるため、httpなどを指定します。

Mercurialのデフォルトbranchは「default」です。pollInterval=3030秒ごとに、新しいコミットを確認します(これはおもちゃの例からのもので、実際には30を超える方が適しています)。

これで、コミットが検出されてスケジューラーによって渡された後にビルドするビルダーは次のようになります。

from buildbot.process.factory import BuildFactory
from buildbot.steps.source.mercurial import Mercurial

factory = BuildFactory()

#watch out: this function is Mercurial, NOT Hg

checkout_default = Mercurial(repourl="/home/user/test/my_project/",
                      defaultBranch='default',
                      branchType='inrepo',
                      haltOnFailure = True)

factory.addStep(checkout_default)

# then you add some build instructions and don't forget to import the necessary...

私の物がうまくいかなかった理由を説明するのは、私が指定しなかったということdefaultBranchですbranchType。これらのキーワードはGit()と同じではないので、注意してください。オンラインのユーザーマニュアルでそれらを見つけられなかったので、これは少しトリッキーですが、Pythonインタープリター内で少し時間をとればそこにあります:

import buildbot
help(buildbot.steps.source.mercurial)

buildbot.steps.source.mercurialまた、これはからインポートされたMercurial関数であり、からインポートされたインポートと同じMercurial関数ではないことに注意してくださいbuildbot.steps.source.Mercurial。後者は非推奨です(または古いバージョンで使用するもの)。それを指摘してくれたfreenodeのIRCbuildbotチャンネルのtomprinceに感謝します。

于 2013-11-23T01:03:02.190 に答える
2

あなたが見た例は非常に古いものです。c['bots']少し前に名前が変更されc['slaves']、さらに多くの変更が加えられました。

構成については、Buildbotのマニュアルを参照することをお勧めします。

http://buildbot.net/buildbot/docs/current/Configuration.html#Configuration

また、インストールセクションもあります。これは、古いバージョンだけでなく、新しいバージョンのBuildBotをセットアップするために必要なことを確実に実行するためです。

http://buildbot.net/buildbot/docs/current/Installation.html#Installation

提供された1つの例は、MercurialリポジトリからビルドするIcedTeaビルドボットでした。構成はここで閲覧できます:

http://icedtea.classpath.org/hg/buildbot/file

また、irc.freenode.netの#buildbotに立ち寄って助けを求めることもできます。

于 2011-03-08T20:19:51.153 に答える