-
-
Save whitequark/516973336a55971e2507 to your computer and use it in GitHub Desktop.
buildmaster config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- python -*- # ex: set syntax=python: | |
# This is a sample buildmaster config file. It must be installed as | |
# 'master.cfg' in your buildmaster's base directory. | |
# This is the dictionary that the buildmaster pays attention to. We also use | |
# a shorter alias to save typing. | |
c = BuildmasterConfig = {} | |
####### BUILDSLAVES | |
# The 'slaves' list defines the set of recognized buildslaves. Each element is | |
# a BuildSlave object, specifying a unique slave name and password. The same | |
# slave name and password must be configured on the slave. | |
from buildbot.buildslave import BuildSlave | |
c['slaves'] = [ | |
BuildSlave("self", "7O3MCLblBKlbktsg2aBt", | |
properties={ 'jobs' : 2 }) | |
] | |
# 'slavePortnum' defines the TCP port to listen on for connections from slaves. | |
# This must match the value configured into the buildslaves (with their | |
# --master option) | |
c['slavePortnum'] = 9989 | |
####### BUILDERS | |
# The 'builders' list defines the Builders, which tell Buildbot how to perform a build: | |
# what steps, and which slaves can execute them. Note that any particular build will | |
# only take place on one slave. | |
from buildbot.process.factory import BuildFactory | |
from buildbot.steps.source import Git | |
from buildbot.steps.shell import Configure, SetProperty, ShellCommand | |
from buildbot.steps.master import MasterShellCommand | |
from buildbot.steps.transfer import FileUpload, FileDownload | |
from buildbot.steps.trigger import Trigger | |
from buildbot.process.properties import WithProperties | |
def getOPAMBuildFactory(docker_image, git_branch): | |
f = BuildFactory() | |
f.addStep( | |
ShellCommand( | |
command = ["docker", "run", ("opam:%s" % docker_image), | |
"sh", "-c", 'git remote rm origin && git remote add origin git://github.com/whitequark/opam-repository &&' | |
' git fetch origin && git reset --hard origin/master && ./.docker-ci.sh'], | |
name = "docker", | |
description = "running tests", | |
descriptionDone = "run tests", | |
haltOnFailure = True)) | |
return f | |
from buildbot.config import BuilderConfig | |
def getBuilder(slavenames, docker_image, git_branch): | |
b = [] | |
b.append( | |
BuilderConfig( | |
name = docker_image, | |
slavenames = slavenames, | |
factory = getOPAMBuildFactory(docker_image, git_branch))) | |
return b | |
builderNames = ["ubuntu-trusty-4.02.1"] | |
c['builders'] = [] | |
for docker_image in builderNames: | |
c['builders'].extend( | |
getBuilder( | |
slavenames = ["self"], | |
docker_image = docker_image, | |
git_branch = "master")) | |
####### SCHEDULERS | |
from buildbot.schedulers.forcesched import ForceScheduler | |
from buildbot.schedulers.basic import SingleBranchScheduler | |
from buildbot.schedulers.triggerable import Triggerable | |
from buildbot.changes import filter | |
c['schedulers'] = [] | |
c['schedulers'].append( | |
ForceScheduler( | |
name = "force", | |
builderNames = builderNames)) | |
c['schedulers'].append( | |
SingleBranchScheduler( | |
name = "github", | |
change_filter = filter.ChangeFilter(project='opam-repository'), | |
treeStableTimer = 5, | |
builderNames = builderNames)) | |
####### STATUS TARGETS | |
# 'status' is a list of Status Targets. The results of each build will be | |
# pushed to these targets. buildbot/status/*.py has a variety to choose from, | |
# including web pages, email senders, and IRC bots. | |
c['status'] = [] | |
from buildbot.status import html, words, mail | |
from buildbot.status.web import authz, auth | |
authz_cfg=authz.Authz( | |
auth = auth.BasicAuth([("opam", "12345")]), | |
gracefulShutdown = False, | |
forceBuild = 'auth', # use this to test your slave once it is set up | |
forceAllBuilds = False, | |
pingBuilder = True, | |
stopBuild = True, | |
stopAllBuilds = False, | |
cancelPendingBuild = True, | |
) | |
c['status'].append( | |
html.WebStatus( | |
http_port = 'unix:/tmp/bb-opam.sock', | |
authz = authz_cfg, | |
change_hook_dialects = { 'github' : True })) | |
####### PROJECT IDENTITY | |
# the 'title' string will appear at the top of this buildbot | |
# installation's html.WebStatus home page (linked to the | |
# 'titleURL') and is embedded in the title of the waterfall HTML page. | |
c['title'] = "opam-repository" | |
c['titleURL'] = "https://github.com/ocaml/opam-repository" | |
# the 'buildbotURL' string should point to the location where the buildbot's | |
# internal web server (usually the html.WebStatus page) is visible. This | |
# typically uses the port number set in the Waterfall 'status' entry, but | |
# with an externally-visible host name which the buildbot cannot figure out | |
# without some help. | |
c['buildbotURL'] = "http://opam-buildbot.whitequark.org/" | |
####### DB URL | |
c['db'] = { | |
# This specifies what database buildbot uses to store its state. You can leave | |
# this at its default for all but the largest installations. | |
'db_url' : "sqlite:///state.sqlite", | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment