Advertisement
Guest User

bbot configuration

a guest
Oct 13th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 10.72 KB | None | 0 0
  1. # -*- python -*-
  2. # ex: set filetype=python:
  3.  
  4. from buildbot.plugins import *
  5.  
  6. # first list with only configuration that build fast enough
  7. configs_fast = []
  8. configs_fast.append("apalis_imx6")
  9. configs_fast.append("atf_fvp")
  10. configs_fast.append("cc10c")
  11.  
  12. # duplicate list to build a complete list
  13. configs = list(configs_fast)
  14. configs.append("cc10c_openvpn")
  15. configs.append("colibri_sfu")
  16.  
  17. sched_fast = map(lambda x: "%s-tests"%x, onfigs_fast)
  18. sched = map(lambda x: "%s-tests"%x, configs)
  19.  
  20. # This is a sample buildmaster config file. It must be installed as
  21. # 'master.cfg' in your buildmaster's base directory.
  22.  
  23. # This is the dictionary that the buildmaster pays attention to. We also use
  24. # a shorter alias to save typing.
  25. c = BuildmasterConfig = {}
  26.  
  27. ####### WORKERS
  28.  
  29. # The 'workers' list defines the set of recognized workers. Each element is
  30. # a Worker object, specifying a unique worker name and password.  The same
  31. # worker name and password must be configured on the worker.
  32. c['workers'] = [
  33.                 worker.Worker("worker1", "pass"),
  34.                 worker.Worker("worker2", "pass"),
  35.                 worker.Worker("worker3", "pass"),
  36.             ]
  37.  
  38. # 'protocols' contains information about protocols which master will use for
  39. # communicating with workers. You must define at least 'port' option that workers
  40. # could connect to your master with this protocol.
  41. # 'port' must match the value configured into the workers (with their
  42. # --master option)
  43. c['protocols'] = {'pb': {'port': 9989}}
  44.  
  45. ####### CHANGESOURCES
  46.  
  47. # the 'change_source' setting tells the buildmaster how it should find out
  48. # about source code changes.  Here we point to the buildbot clone of pyflakes.
  49.  
  50. c['change_source'] = []
  51. # For future ref:
  52. #c['change_source'].append(changes.GitPoller(
  53. #        'git://github.com/buildbot/pyflakes.git',
  54. #        workdir='gitpoller-workdir', branch='master',
  55. #        pollinterval=300))
  56.  
  57. c['change_source'].append(changes.PBChangeSource(port=9999, user='forceall',
  58.                                     passwd='mdpbidon'))
  59.  
  60. ####### SCHEDULERS
  61.  
  62. # Configure the Schedulers, which decide how to react to incoming changes.  In this
  63. # case, just kick off a 'runtests' build
  64.  
  65. c['schedulers'] = []
  66. # Force all 'fast' builds
  67. c['schedulers'].append(schedulers.SingleBranchScheduler(
  68.                             name="remote-all-fast",
  69.                             change_filter=util.ChangeFilter(branch_re='.*', category='fast'),
  70.                             treeStableTimer=None,
  71.                             builderNames=sched_fast))
  72. # Force all builds
  73. c['schedulers'].append(schedulers.SingleBranchScheduler(
  74.                             name="remote-all",
  75.                             change_filter=util.ChangeFilter(branch_re='.*', category='all'),
  76.                             treeStableTimer=None,
  77.                             builderNames=sched))
  78. # Force a single build
  79. for cfg in configs:
  80.     c['schedulers'].append(schedulers.SingleBranchScheduler(
  81.                             name=cfg,
  82.                             change_filter=util.ChangeFilter(branch_re='.*', category=cfg),
  83.                             treeStableTimer=None,
  84.                             builderNames=['%s-tests'%cfg]))
  85.  
  86. # Force a build using web interface
  87. c['schedulers'].append(schedulers.ForceScheduler(
  88.                             name="force",
  89.                             builderNames=sched))
  90.  
  91.  
  92. # Force all 'fast' builds with local patch ('try' scheduler)
  93. c['schedulers'].append(schedulers.Try_Userpass(
  94.                         name="try_fast",
  95.                         builderNames=sched_fast,
  96.                         port=8031,
  97.                         userpass=[("vsiles","trypass")]))
  98.  
  99.  
  100. ####### BUILDERS
  101.  
  102. # The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
  103. # what steps, and which workers can execute them.  Note that any particular build will
  104. # only take place on one worker.
  105.  
  106. c['builders'] = []
  107.  
  108. # Custom env since my CROSS_COMPILE variable is a bit messy
  109. ccenv = {
  110. #    'CROSS_COMPILE':'/home/vsiles/BackUpExclusion/programs/arm/gcc-linaro-arm-none-eabi-4.8-2014.04_linux/bin/arm-none-eabi-'
  111.     'CROSS_COMPILE':'/home/vsiles/BackUpExclusion/programs/arm/gcc6/gcc-linaro-6.3.1-2017.02-x86_64_arm-eabi/bin/arm-eabi-'
  112. }
  113.  
  114. checkout = steps.Mercurial(repourl='file:///home/vsiles/boulot/code/prj',
  115.                             mode='full',
  116.                             method='fresh',
  117.                             branchType='inrepo',
  118.                             workdir='build/prj',
  119.                             name='prj checkout',
  120.                             description='checking out...',
  121.                             descriptionDone='prj fetched correctly',
  122.                             haltOnFailure=True)
  123.  
  124. # both Hg repository will be clone and updated to the requested branch, but services
  125. # should be reverted to the default branch
  126. checkoutServices = steps.ShellCommand(name='services checkout',
  127.                             command=['hg', 'clone', 'file:///home/vsiles/boulot/code/services'],
  128.                             description='checking out...',
  129.                             descriptionDone='services fetched correctly',
  130.                             haltOnFailure=True)
  131. updateServices = steps.ShellCommand(name='services update',
  132.                                     description='updating ...',
  133.                                     descriptionDone='services updated correctly',
  134.                                     command=['hg', 'update', 'default'],
  135.                                     workdir='build/services',
  136.                                     haltOnFailure=True)
  137.  
  138.  
  139. local_dir = "/home/vsiles/BackUpExclusion/sandbox/buildbot/"
  140. suppress_path = local_dir + "support/suppress-warning"
  141.  
  142. # TODO: make a class or a function or something more pythonesque ?
  143. for cfg in configs:
  144.     some_build = util.BuildFactory()
  145.     some_build.addStep(checkout)
  146.     some_build.addStep(checkoutServices)
  147.     some_build.addStep(updateServices)
  148.     some_build.addStep(steps.Compile(name='make %s_config'%cfg,
  149.                                     command=['make', '-j8', '%s_config'%cfg],
  150. #                                    command=['make', '%s_config'%cfg],
  151.                                     description='make %s_config'%cfg,
  152.                                     descriptionDone='general config: ok',
  153.                                     workdir='build/prj',
  154.                                     env=ccenv,
  155.                                     haltOnFailure=True,
  156.                                     warnOnWarnings=True,
  157.                                     suppressionFile=suppress_path))
  158.     some_build.addStep(steps.Compile(name='make config',
  159.                                     command=['make', '-j8', 'config'],
  160. #                                    command=['make', 'config'],
  161.                                     description='make config',
  162.                                     descriptionDone='applications config: ok',
  163.                                     workdir='build/prj',
  164.                                     env=ccenv,
  165.                                     haltOnFailure=True,
  166.                                     warnOnWarnings=True,
  167.                                     suppressionFile=suppress_path))
  168.     some_build.addStep(steps.Compile(name='make programs',
  169.                                     command=['make', '-j8', 'programs'],
  170. #                                    command=['make', 'programs'],
  171.                                     description='make programs',
  172.                                     descriptionDone='applications build: ok',
  173.                                     workdir='build/prj',
  174.                                     env=ccenv,
  175.                                     haltOnFailure=True,
  176.                                     warnOnWarnings=True,
  177.                                     suppressionFile=suppress_path))
  178.     some_build.addStep(steps.Compile(name='make all',
  179.                                     command=['make', '-j8', 'all'],
  180. #                                    command=['make', 'all'],
  181.                                     description='make all',
  182.                                     descriptionDone='full build: ok',
  183.                                     workdir='build/prj',
  184.                                     env=ccenv,
  185.                                     haltOnFailure=True,
  186.                                     warnOnWarnings=True,
  187.                                     suppressionFile=suppress_path))
  188.     some_build.addStep(steps.RemoveDirectory(dir='build/prj',
  189.                                     name='cleaning prj',
  190.                                     description='cleaning prj',
  191.                                     descriptionDone='prj successfully deleted',
  192.                                     alwaysRun=True))
  193.     some_build.addStep(steps.RemoveDirectory(dir='build/services',
  194.                                     name='cleaning services',
  195.                                     description='cleaning services',
  196.                                     descriptionDone='services successfully deleted',
  197.                                     alwaysRun=True))
  198.  
  199.     c['builders'].append(
  200.         util.BuilderConfig(name='%s-tests'%cfg,
  201.                            workernames=[ 'worker1', 'worker2', 'worker3' ],
  202.                            factory=some_build))
  203.  
  204. ####### BUILDBOT SERVICES
  205.  
  206. # 'services' is a list of BuildbotService items like reporter targets. The
  207. # status of each build will be pushed to these targets. buildbot/reporters/*.py
  208. # has a variety to choose from, like IRC bots.
  209.  
  210. def http_format(build):
  211.     build['custom'] = 'vsiles'
  212.     return build
  213.  
  214. c['services'] = []
  215. c['services'].append(reporters.HttpStatusPush(serverUrl='http://127.0.0.1:8080/bbreport',
  216.                                               format_fn=http_format,
  217.                                               wantSteps=True, wantLogs=True))
  218.  
  219. ####### PROJECT IDENTITY
  220.  
  221. # the 'title' string will appear at the top of this buildbot installation's
  222. # home pages (linked to the 'titleURL').
  223.  
  224. c['title'] = "vsiles project"
  225. c['titleURL'] = "localhost@project"
  226.  
  227. # the 'buildbotURL' string should point to the location where the buildbot's
  228. # internal web server is visible. This typically uses the port number set in
  229. # the 'www' entry below, but with an externally-visible host name which the
  230. # buildbot cannot figure out without some help.
  231.  
  232. c['buildbotURL'] = "http://localhost:8010/"
  233.  
  234. # minimalistic config to activate new web UI
  235. c['www'] = dict(port=8010,
  236.                 plugins=dict(waterfall_view={}, console_view={}))
  237.  
  238. ####### DB URL
  239.  
  240. c['db'] = {
  241.     # This specifies what database buildbot uses to store its state.  You can leave
  242.     # this at its default for all but the largest installations.
  243.     'db_url' : "sqlite:///state.sqlite",
  244. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement