25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

122 satır
2.9KB

  1. {{ansible_managed|comment}}
  2. from buildbot.plugins import *
  3. c = BuildmasterConfig = {}
  4. c['workers'] = []
  5. c['change_source'] = []
  6. c['schedulers'] = []
  7. c['builders'] = []
  8. c['services'] = []
  9. c['protocols'] = {
  10. 'pb': {
  11. 'port': "tcp:9989:interface=127.0.0.1"
  12. }
  13. }
  14. c['title'] = "buildbot title"
  15. c['titleURL'] = "https://github.com/covid-videoplattform"
  16. c['buildbotURL'] = "https://{{buildbot_server_name}}/"
  17. c['www'] = dict(
  18. port="unix:address=/run/buildbot/{{buildbot_server_name}}.www.sock",
  19. plugins = dict(
  20. waterfall_view={},
  21. console_view={},
  22. grid_view={},
  23. badges={"left_pad": 0, "right_pad": 0, "border_radius": 3, "style": "badgeio"},
  24. ),
  25. change_hook_dialects={
  26. 'github': {}
  27. },
  28. )
  29. c['db'] = {
  30. 'db_url' : "{{buildbot_database_url}}",
  31. }
  32. # Local Worker
  33. {% if buildbot_local_worker %}
  34. c['workers'].append(worker.LocalWorker("local-worker"))
  35. {% endif %}
  36. # Ansible Defined Workers
  37. {% for worker_name in buildbot_workers.keys() %}
  38. {% set worker = buildbot_workers[worker_name] %}
  39. c['workers'].append(worker.Worker('{{worker_name}}', '{{worker.password|default(ansible_local.buildbot.workers[worker_name].password)}}'))
  40. {% endfor %}
  41. # Hello World Example
  42. {% if buildbot_hello_world_example %}
  43. factory = util.BuildFactory()
  44. factory.addStep(steps.Git(repourl='git://github.com/buildbot/hello-world.git', mode='incremental'))
  45. factory.addStep(steps.ShellCommand(command=["trial", "hello"], env={"PYTHONPATH": "."}))
  46. c['builders'].append(
  47. util.BuilderConfig(name="hello-world",
  48. workernames=["local-worker"],
  49. factory=factory))
  50. c['schedulers'].append(schedulers.ForceScheduler(
  51. name="force-hello-world",
  52. builderNames=["hello-world"],
  53. ))
  54. {% endif %}
  55. # Ansible Defined Builders
  56. {% for builder_name in buildbot_builders.keys() %}
  57. {% set builder = buildbot_builders[builder_name] %}
  58. factory = util.BuildFactory()
  59. {% for repo in builder.repos %}
  60. {% if repo.type | default('github') == 'github' %}
  61. factory.addStep(steps.GitHub(
  62. name='{{repo.name}}',
  63. repourl='{{repo.repourl}}',
  64. mode='incremental',
  65. workdir='{{repo.workdir}}',
  66. alwaysUseLatest=True,
  67. ))
  68. {% elif repo.type == 'gitea' %}
  69. factory.addStep(steps.Gitea(
  70. name='{{repo.name}}',
  71. repourl='{{repo.repourl}}',
  72. mode='incremental',
  73. workdir='{{repo.workdir}}',
  74. branch="master",
  75. progress=True,
  76. logEnviron=False,
  77. ))
  78. {% endif %}
  79. {% endfor %}
  80. {% for cmd in builder.shell_commands %}
  81. factory.addStep(steps.ShellCommand(
  82. name='{{cmd.name}}',
  83. command='{{cmd.command}}',
  84. workdir='{{cmd.workdir}}',
  85. ))
  86. {% endfor %}
  87. c['builders'].append(
  88. util.BuilderConfig(
  89. name="{{builder_name}}",
  90. workernames=["local-worker"],
  91. factory=factory
  92. )
  93. )
  94. c['schedulers'].append(schedulers.SingleBranchScheduler(
  95. name="{{builder_name}}",
  96. change_filter=util.ChangeFilter(branch='master'),
  97. treeStableTimer=5,
  98. builderNames=['{{builder_name}}']))
  99. {% endfor %}