{{ansible_managed|comment}} from buildbot.plugins import * c = BuildmasterConfig = {} c['workers'] = [] c['change_source'] = [] c['schedulers'] = [] c['builders'] = [] c['services'] = [] c['protocols'] = { 'pb': { 'port': "tcp:9989:interface=127.0.0.1" } } c['title'] = "buildbot title" c['titleURL'] = "https://github.com/covid-videoplattform" c['buildbotURL'] = "https://{{buildbot_server_name}}/" c['www'] = dict( port="unix:address=/run/buildbot/{{buildbot_server_name}}.www.sock", plugins = dict( waterfall_view={}, console_view={}, grid_view={}, badges={"left_pad": 0, "right_pad": 0, "border_radius": 3, "style": "badgeio"}, ), change_hook_dialects={ {% if buildbot_github_change_hook %} 'github': {}, {% endif %} {% if buildbot_gitea_change_hook %} 'gitea': { 'secret': '{{buildbot_gitea_webhook_secret}}', 'onlyIncludePushCommit': False, }, {% endif %} }, ) c['db'] = { 'db_url' : "{{buildbot_database_url}}", } # Local Worker {% if buildbot_local_worker %} c['workers'].append(worker.LocalWorker("local-worker")) {% endif %} # Ansible Defined Workers {% for worker_name in buildbot_workers.keys() %} {% set worker = buildbot_workers[worker_name] %} c['workers'].append(worker.Worker('{{worker_name}}', '{{worker.password|default(ansible_local.buildbot.workers[worker_name].password)}}')) {% endfor %} # Hello World Example {% if buildbot_hello_world_example %} factory = util.BuildFactory() factory.addStep(steps.Git(repourl='git://github.com/buildbot/hello-world.git', mode='incremental')) factory.addStep(steps.ShellCommand(command=["trial", "hello"], env={"PYTHONPATH": "."})) c['builders'].append( util.BuilderConfig( name="hello-world", workernames=["local-worker"], factory=factory ) ) c['schedulers'].append(schedulers.ForceScheduler( name="force-hello-world", builderNames=["hello-world"], )) {% endif %} # Ansible Defined Builders {% for builder_name in buildbot_builders.keys() %} {% set builder = buildbot_builders[builder_name] %} factory = util.BuildFactory() {% for repo in builder.repos %} {% if repo.type | default('github') == 'github' %} factory.addStep(steps.GitHub( name='{{repo.name}}', repourl='{{repo.repourl}}', mode='incremental', workdir='{{repo.workdir}}', alwaysUseLatest=True, )) {% elif repo.type == 'gitea' %} factory.addStep(steps.Gitea( name='{{repo.name}}', repourl='{{repo.repourl}}', mode='incremental', workdir='{{repo.workdir}}', branch='{{repo.branch|default('master')}}', progress=True, logEnviron=False, )) {% endif %} {% endfor %} {% for cmd in builder.shell_commands %} factory.addStep(steps.ShellCommand( name='{{cmd.name}}', command='{{cmd.command}}', workdir='{{cmd.workdir}}', )) {% endfor %} c['builders'].append( util.BuilderConfig( name="{{builder_name}}", workernames={{builder.worker_names|to_json}}, factory=factory ) ) c['schedulers'].append(schedulers.SingleBranchScheduler( name="{{builder_name}}", change_filter=util.ChangeFilter(branch='{{repo.branch|default('master')}}'), treeStableTimer=5, builderNames=['{{builder_name}}'], )) {% if builder.force_scheduler | default(false) %} c['schedulers'].append(schedulers.ForceScheduler( name="force-{{builder_name}}", builderNames=["{{builder_name}}"], )) {% endif %} {% endfor %}