如何使用buildbot构建每个标签?

时间:2019-02-26 14:46:30

标签: git continuous-integration buildbot

如何设置Buildbot来构建每个推送的标签?我当前的配置:

c["change_source"].append(changes.GitPoller(
    repourl = "git@server:buildbot-test.git",
    pollInterval = 3,
    pollAtLaunch = True,
    only_tags = True,
    project = "buildbot-test",
    buildPushesWithNoCommits = True,
))

c["schedulers"].append(schedulers.SingleBranchScheduler(
    name = "buildbot-test",
    change_filter = util.ChangeFilter(project = "buildbot-test"),
    builderNames = ["buildbot-test"],
    treeStableTimer = 10,
))

factory = util.BuildFactory()

factory.addStep(steps.Git(
    repourl='git@server:buildbot-test.git',
    progress=True,
))

factory.addStep(steps.ShellCommand(
    name="Generate build stages",
    command=["./build.sh", "--list-stages", util.Property("branch")],
    haltOnFailure=True,
))

c['builders'].append(util.BuilderConfig(
    name='buildbot-test',
    description='Buildbot Test',
    workernames=['my-worker'],
    factory=factory,
))

这在我第一次标记提交时有效。但是当我第二次标记提交时,不会触发构建。

1 个答案:

答案 0 :(得分:1)

最后我问了IRC。有人告诉我这是可能的:GitPoller不是推荐的获取更改的方法,因此可能会有一些错误。

首选方法是在SCM服务器中设置钩子,并使用Buildbot的REST API将更改推送到Buildbot。