From f66d0a38c435e05d0d5d3c85df3cd8108679e1cb Mon Sep 17 00:00:00 2001 From: Markus Katharina Brechtel Date: Tue, 5 May 2020 14:21:46 +0200 Subject: [PATCH] Hello World example builder --- defaults/main.yaml | 2 ++ templates/buildbot/master.cfg.j2 | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/defaults/main.yaml b/defaults/main.yaml index d2dd99a..81ec2b6 100644 --- a/defaults/main.yaml +++ b/defaults/main.yaml @@ -7,3 +7,5 @@ buildbot_db_pass: "{{ ansible_local.buildbot.database_password }}" buildbot_server_name: "{{ inventory_hostname }}" buildbot_builders: {} + +buildbot_hello_world_example: true diff --git a/templates/buildbot/master.cfg.j2 b/templates/buildbot/master.cfg.j2 index 145a213..f6ae44b 100644 --- a/templates/buildbot/master.cfg.j2 +++ b/templates/buildbot/master.cfg.j2 @@ -15,6 +15,26 @@ c['schedulers'] = [] c['builders'] = [] +# 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()