gitcontinuous-integrationbuildbot

How to build every tag with buildbot?


How do I set up Buildbot to build every pushed tag? My current configuration:

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,
))

This works when I tag a commit for the first time. But when I tag the commit for the second time, the build is not triggered.


Solution

  • At the end I asked on IRC. I've been told that this was possible: GitPoller was not the recommended way to get changes, so it could have some bugs.

    The preferred way is to set up hook in the SCM server and push changes to Buildbot using Buildbot's REST API.