Advertisement
Guest User

Untitled

a guest
Feb 17th, 2022
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.62 KB | None | 0 0
  1. # -*- python -*-
  2. # ex: set filetype=python:
  3.  
  4. import os
  5.  
  6. from buildbot.plugins import *
  7.  
  8. # This is a sample buildmaster config file. It must be installed as
  9. # 'master.cfg' in your buildmaster's base directory.
  10.  
  11. # This is the dictionary that the buildmaster pays attention to. We also use
  12. # a shorter alias to save typing.
  13. c = BuildmasterConfig = {}
  14.  
  15. ####### WORKERS
  16.  
  17. # The 'workers' list defines the set of recognized workers. Each element is
  18. # a Worker object, specifying a unique worker name and password.  The same
  19. # worker name and password must be configured on the worker.
  20.  
  21. c["workers"] = [
  22.     worker.Worker("Worker-1", "pass")
  23. ]
  24.  
  25. if "BUILDBOT_MQ_URL" in os.environ:
  26.     c["mq"] = {
  27.         "type": "wamp",
  28.         "router_url": os.environ["BUILDBOT_MQ_URL"],
  29.         "realm": os.environ.get("BUILDBOT_MQ_REALM", "buildbot").decode("utf-8"),
  30.         "debug": "BUILDBOT_MQ_DEBUG" in os.environ,
  31.         "debug_websockets": "BUILDBOT_MQ_DEBUG" in os.environ,
  32.         "debug_lowlevel": "BUILDBOT_MQ_DEBUG" in os.environ,
  33.     }
  34. # 'protocols' contains information about protocols which master will use for
  35. # communicating with workers. You must define at least 'port' option that workers
  36. # could connect to your master with this protocol.
  37. # 'port' must match the value configured into the workers (with their
  38. # --master option)
  39. c["protocols"] = {"pb": {"port": os.environ.get("BUILDBOT_WORKER_PORT", 9989)}}
  40.  
  41. ####### CHANGESOURCES
  42.  
  43. # the 'change_source' setting tells the buildmaster how it should find out
  44. # about source code changes.  Here we point to the buildbot clone of pyflakes.
  45.  
  46. c["change_source"] = []
  47. # c['change_source'].append(changes.GitPoller(
  48. #         'git://github.com/buildbot/pyflakes.git',
  49. #         workdir='gitpoller-workdir', branch='master',
  50. #         pollinterval=300))
  51.  
  52. ####### SCHEDULERS
  53.  
  54. # Configure the Schedulers, which decide how to react to incoming changes.  In this
  55. # case, just kick off a 'runtests' build
  56.  
  57. c["schedulers"] = []
  58. c["schedulers"].append(
  59.     schedulers.SingleBranchScheduler(
  60.         name="all",
  61.         branch='main',
  62.         # change_filter=util.ChangeFilter(
  63.         #     category='pull',
  64.         #     repository=os.environ['GITHUB_REPO_URL'],
  65.         # ),
  66.         treeStableTimer=None,
  67.         builderNames=["RustBuilder-1"],
  68.     )
  69. )
  70. c["schedulers"].append(
  71.     schedulers.ForceScheduler(name="force", builderNames=["RustBuilder-1"])
  72. )
  73.  
  74. ####### BUILDERS
  75.  
  76. # The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
  77. # what steps, and which workers can execute them.  Note that any particular build will
  78. # only take place on one worker.
  79.  
  80. factory = util.BuildFactory()
  81. # check out the source
  82. factory.addStep(steps.GitHub(
  83.     repourl=os.environ["GITHUB_REPO_URL"],
  84.     mode='full',
  85.     method='clobber',
  86. ))
  87. # run the tests (note that this will require that 'trial' is installed)
  88. factory.addStep(steps.ShellCommand(command=["cargo", "test"]))
  89.  
  90. c["builders"] = []
  91. c["builders"].append(
  92.     util.BuilderConfig(name="RustBuilder-1", workernames=["Worker-1"], factory=factory)
  93. )
  94.  
  95. ####### REPORTER TARGETS
  96.  
  97. # 'services' is a list of Reporter Targets. The results of each build will be
  98. # pushed to these targets. buildbot/reporters/*.py has a variety to choose from,
  99. # like IRC bots.
  100.  
  101. context = util.Interpolate("bb/%(prop:buildername)s")
  102. c["services"] = [
  103.     reporters.GitHubStatusPush(token=os.environ["GITHUB_TOKEN"], context=context)
  104. ]
  105.  
  106. ####### PROJECT IDENTITY
  107.  
  108. # the 'title' string will appear at the top of this buildbot installation's
  109. # home pages (linked to the 'titleURL').
  110.  
  111. c["title"] = "Efinity"
  112. c["titleURL"] = "https://efinity.io"
  113.  
  114. # the 'buildbotURL' string should point to the location where the buildbot's
  115. # internal web server is visible. This typically uses the port number set in
  116. # the 'www' entry below, but with an externally-visible host name which the
  117. # buildbot cannot figure out without some help.
  118.  
  119. c["buildbotURL"] = os.environ.get("BUILDBOT_WEB_URL", "http://localhost:8010/")
  120.  
  121. # minimalistic config to activate new web UI
  122. c["www"] = dict(
  123.     port=os.environ.get("BUILDBOT_WEB_PORT", 8010),
  124.     plugins=dict(waterfall_view={}, console_view={}),
  125.     change_hook_dialects={
  126.         'github': {
  127.             'token': os.environ['GITHUB_TOKEN'],
  128.             'secret': 'blahblah',
  129.             'strict': True,
  130.         }
  131.     }
  132. )
  133.  
  134. ####### DB URL
  135.  
  136. c["db"] = {
  137.     # This specifies what database buildbot uses to store its state.  You can leave
  138.     # this at its default for all but the largest installations.
  139.     "db_url": os.environ.get("BUILDBOT_DB_URL", "sqlite://").format(**os.environ),
  140. }
  141.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement