Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- python -*-
- # ex: set filetype=python:
- from buildbot.plugins import *
- # first list with only configuration that build fast enough
- configs_fast = []
- configs_fast.append("apalis_imx6")
- configs_fast.append("atf_fvp")
- configs_fast.append("cc10c")
- # duplicate list to build a complete list
- configs = list(configs_fast)
- configs.append("cc10c_openvpn")
- configs.append("colibri_sfu")
- sched_fast = map(lambda x: "%s-tests"%x, onfigs_fast)
- sched = map(lambda x: "%s-tests"%x, configs)
- # 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 = {}
- ####### WORKERS
- # The 'workers' list defines the set of recognized workers. Each element is
- # a Worker object, specifying a unique worker name and password. The same
- # worker name and password must be configured on the worker.
- c['workers'] = [
- worker.Worker("worker1", "pass"),
- worker.Worker("worker2", "pass"),
- worker.Worker("worker3", "pass"),
- ]
- # 'protocols' contains information about protocols which master will use for
- # communicating with workers. You must define at least 'port' option that workers
- # could connect to your master with this protocol.
- # 'port' must match the value configured into the workers (with their
- # --master option)
- c['protocols'] = {'pb': {'port': 9989}}
- ####### CHANGESOURCES
- # the 'change_source' setting tells the buildmaster how it should find out
- # about source code changes. Here we point to the buildbot clone of pyflakes.
- c['change_source'] = []
- # For future ref:
- #c['change_source'].append(changes.GitPoller(
- # 'git://github.com/buildbot/pyflakes.git',
- # workdir='gitpoller-workdir', branch='master',
- # pollinterval=300))
- c['change_source'].append(changes.PBChangeSource(port=9999, user='forceall',
- passwd='mdpbidon'))
- ####### SCHEDULERS
- # Configure the Schedulers, which decide how to react to incoming changes. In this
- # case, just kick off a 'runtests' build
- c['schedulers'] = []
- # Force all 'fast' builds
- c['schedulers'].append(schedulers.SingleBranchScheduler(
- name="remote-all-fast",
- change_filter=util.ChangeFilter(branch_re='.*', category='fast'),
- treeStableTimer=None,
- builderNames=sched_fast))
- # Force all builds
- c['schedulers'].append(schedulers.SingleBranchScheduler(
- name="remote-all",
- change_filter=util.ChangeFilter(branch_re='.*', category='all'),
- treeStableTimer=None,
- builderNames=sched))
- # Force a single build
- for cfg in configs:
- c['schedulers'].append(schedulers.SingleBranchScheduler(
- name=cfg,
- change_filter=util.ChangeFilter(branch_re='.*', category=cfg),
- treeStableTimer=None,
- builderNames=['%s-tests'%cfg]))
- # Force a build using web interface
- c['schedulers'].append(schedulers.ForceScheduler(
- name="force",
- builderNames=sched))
- # Force all 'fast' builds with local patch ('try' scheduler)
- c['schedulers'].append(schedulers.Try_Userpass(
- name="try_fast",
- builderNames=sched_fast,
- port=8031,
- userpass=[("vsiles","trypass")]))
- ####### BUILDERS
- # The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
- # what steps, and which workers can execute them. Note that any particular build will
- # only take place on one worker.
- c['builders'] = []
- # Custom env since my CROSS_COMPILE variable is a bit messy
- ccenv = {
- # 'CROSS_COMPILE':'/home/vsiles/BackUpExclusion/programs/arm/gcc-linaro-arm-none-eabi-4.8-2014.04_linux/bin/arm-none-eabi-'
- 'CROSS_COMPILE':'/home/vsiles/BackUpExclusion/programs/arm/gcc6/gcc-linaro-6.3.1-2017.02-x86_64_arm-eabi/bin/arm-eabi-'
- }
- checkout = steps.Mercurial(repourl='file:///home/vsiles/boulot/code/prj',
- mode='full',
- method='fresh',
- branchType='inrepo',
- workdir='build/prj',
- name='prj checkout',
- description='checking out...',
- descriptionDone='prj fetched correctly',
- haltOnFailure=True)
- # both Hg repository will be clone and updated to the requested branch, but services
- # should be reverted to the default branch
- checkoutServices = steps.ShellCommand(name='services checkout',
- command=['hg', 'clone', 'file:///home/vsiles/boulot/code/services'],
- description='checking out...',
- descriptionDone='services fetched correctly',
- haltOnFailure=True)
- updateServices = steps.ShellCommand(name='services update',
- description='updating ...',
- descriptionDone='services updated correctly',
- command=['hg', 'update', 'default'],
- workdir='build/services',
- haltOnFailure=True)
- local_dir = "/home/vsiles/BackUpExclusion/sandbox/buildbot/"
- suppress_path = local_dir + "support/suppress-warning"
- # TODO: make a class or a function or something more pythonesque ?
- for cfg in configs:
- some_build = util.BuildFactory()
- some_build.addStep(checkout)
- some_build.addStep(checkoutServices)
- some_build.addStep(updateServices)
- some_build.addStep(steps.Compile(name='make %s_config'%cfg,
- command=['make', '-j8', '%s_config'%cfg],
- # command=['make', '%s_config'%cfg],
- description='make %s_config'%cfg,
- descriptionDone='general config: ok',
- workdir='build/prj',
- env=ccenv,
- haltOnFailure=True,
- warnOnWarnings=True,
- suppressionFile=suppress_path))
- some_build.addStep(steps.Compile(name='make config',
- command=['make', '-j8', 'config'],
- # command=['make', 'config'],
- description='make config',
- descriptionDone='applications config: ok',
- workdir='build/prj',
- env=ccenv,
- haltOnFailure=True,
- warnOnWarnings=True,
- suppressionFile=suppress_path))
- some_build.addStep(steps.Compile(name='make programs',
- command=['make', '-j8', 'programs'],
- # command=['make', 'programs'],
- description='make programs',
- descriptionDone='applications build: ok',
- workdir='build/prj',
- env=ccenv,
- haltOnFailure=True,
- warnOnWarnings=True,
- suppressionFile=suppress_path))
- some_build.addStep(steps.Compile(name='make all',
- command=['make', '-j8', 'all'],
- # command=['make', 'all'],
- description='make all',
- descriptionDone='full build: ok',
- workdir='build/prj',
- env=ccenv,
- haltOnFailure=True,
- warnOnWarnings=True,
- suppressionFile=suppress_path))
- some_build.addStep(steps.RemoveDirectory(dir='build/prj',
- name='cleaning prj',
- description='cleaning prj',
- descriptionDone='prj successfully deleted',
- alwaysRun=True))
- some_build.addStep(steps.RemoveDirectory(dir='build/services',
- name='cleaning services',
- description='cleaning services',
- descriptionDone='services successfully deleted',
- alwaysRun=True))
- c['builders'].append(
- util.BuilderConfig(name='%s-tests'%cfg,
- workernames=[ 'worker1', 'worker2', 'worker3' ],
- factory=some_build))
- ####### BUILDBOT SERVICES
- # 'services' is a list of BuildbotService items like reporter targets. The
- # status of each build will be pushed to these targets. buildbot/reporters/*.py
- # has a variety to choose from, like IRC bots.
- def http_format(build):
- build['custom'] = 'vsiles'
- return build
- c['services'] = []
- c['services'].append(reporters.HttpStatusPush(serverUrl='http://127.0.0.1:8080/bbreport',
- format_fn=http_format,
- wantSteps=True, wantLogs=True))
- ####### PROJECT IDENTITY
- # the 'title' string will appear at the top of this buildbot installation's
- # home pages (linked to the 'titleURL').
- c['title'] = "vsiles project"
- c['titleURL'] = "localhost@project"
- # the 'buildbotURL' string should point to the location where the buildbot's
- # internal web server is visible. This typically uses the port number set in
- # the 'www' entry below, but with an externally-visible host name which the
- # buildbot cannot figure out without some help.
- c['buildbotURL'] = "http://localhost:8010/"
- # minimalistic config to activate new web UI
- c['www'] = dict(port=8010,
- plugins=dict(waterfall_view={}, console_view={}))
- ####### 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",
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement