Separate configs

This commit is contained in:
2019-09-06 16:49:06 +02:00
parent 5a13a53be3
commit 3bcb9924fe
25 changed files with 290 additions and 181 deletions

0
config/__init__.py Normal file
View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,24 @@
from buildbot.plugins import steps, util
factory = util.BuildFactory()
# dependencies
factory.addStep(steps.ShellCommand(command=['git', 'clone', '--branch', 'master',
'https://git.blackfinn.de/adc_gpio_i2c/i2c_bb.git']))
factory.addStep(steps.ShellCommand(command=['make', '-C', 'i2c_bb', 'install', '-j8', 'PREFIX=/worker']))
# DUT
factory.addStep(steps.ShellCommand(command=['git', 'clone', '--branch', 'master',
'https://git.blackfinn.de/adc_gpio_i2c/ads1115.git']))
factory.addStep(steps.ShellCommand(command=['make', '-C', 'ads1115', 'check', '-j8']))
factory.addStep(steps.ShellCommand(command=['make', '-C', 'ads1115', 'all', '-j8', 'EXTRA_INC=/worker/include']))
factory.addStep(steps.ShellCommand(command=['make', '-C', 'ads1115', 'exec_unit_test', '-j8', 'EXTRA_INC=/worker/include']))
factory.addStep(steps.ShellCommand(command='make -C ads1115 clean && make -C ads1115 coverage -j8 EXTRA_INC=/worker/include'))
builder = util.BuilderConfig(name='ads1115', workernames=["buildbot-cpp-worker"],
factory=factory)
def append(builders):
builders.append(builder)
return builders

View File

@@ -0,0 +1,19 @@
from buildbot.plugins import steps, util
factory = util.BuildFactory()
factory.addStep(steps.ShellCommand(command=['git', 'clone', '--branch', 'master',
'https://git.blackfinn.de/docker/bicycle-statistics.git']))
factory.addStep(steps.ShellCommand(command=['docker', 'build', '--no-cache', '-t', 'bicycle-statistics',
'./bicycle-statistics']))
factory.addStep(steps.ShellCommand(command=['docker', 'rm', '-f', 'bicycle-statistics']))
factory.addStep(steps.ShellCommand(command=['docker', 'run', '-d', '-v', '/srv/nextcloud/data/tkl/files/Bicycle:/bs_in',
'-v', '/srv/bicycle.blackfinn.de/data:/bs_out', '--name',
'bicycle-statistics', '--restart', 'always', 'bicycle-statistics']))
builder = util.BuilderConfig(name='bicycle_statistics', workernames=["buildbot-cpp-worker"],
factory=factory)
def append(builders):
builders.append(builder)
return builders

View File

@@ -0,0 +1,18 @@
from buildbot.plugins import steps, util
factory = util.BuildFactory()
factory.addStep(steps.Git(repourl='https://git.blackfinn.de/adc_gpio_i2c/gpio_ftdi.git', mode='full'))
factory.addStep(steps.ShellCommand(command=['make', 'check', '-j8']))
factory.addStep(steps.Compile(command=['make', 'all', '-j8']))
factory.addStep(steps.ShellCommand(command=['make', 'build_unit_test', '-j8']))
factory.addStep(steps.ShellCommand(command=['make', 'exec_unit_test']))
factory.addStep(steps.ShellCommand(command='make clean && make coverage'))
builder = util.BuilderConfig(name='gpio_ftdi', workernames=["buildbot-cpp-worker"],
factory=factory)
def append(builders):
builders.append(builder)
return builders

View File

@@ -0,0 +1,17 @@
from buildbot.plugins import steps, util
factory = util.BuildFactory()
factory.addStep(steps.Git(repourl='https://git.blackfinn.de/adc_gpio_i2c/gpio_sys.git', mode='full'))
factory.addStep(steps.ShellCommand(command=['make', 'check', '-j8']))
factory.addStep(steps.Compile(command=['make', 'all', '-j8']))
factory.addStep(steps.ShellCommand(command=['make', 'build_unit_test', '-j8']))
factory.addStep(steps.ShellCommand(command=['make', 'exec_unit_test']))
factory.addStep(steps.ShellCommand(command='make clean && make coverage'))
builder = util.BuilderConfig(name='gpio_sys', workernames=["buildbot-cpp-worker"],
factory=factory)
def append(builders):
builders.append(builder)
return builders

17
config/builders/i2c_bb.py Normal file
View File

@@ -0,0 +1,17 @@
from buildbot.plugins import steps, util
factory = util.BuildFactory()
factory.addStep(steps.ShellCommand(command=['git', 'clone', '--branch', 'master',
'https://git.blackfinn.de/adc_gpio_i2c/i2c_bb.git']))
factory.addStep(steps.ShellCommand(command=['make', '-C', 'i2c_bb', 'check', '-j8']))
factory.addStep(steps.ShellCommand(command=['make', '-C', 'i2c_bb', 'all', '-j8', 'EXTRA_INC=/worker/include']))
factory.addStep(steps.ShellCommand(command=['make', '-C', 'i2c_bb', 'exec_unit_test', '-j8', 'EXTRA_INC=/worker/include']))
factory.addStep(steps.ShellCommand(command='make -C i2c_bb clean && make -C i2c_bb coverage -j8 EXTRA_INC=/worker/include'))
builder = util.BuilderConfig(name='i2c_bb', workernames=["buildbot-cpp-worker"],
factory=factory)
def append(builders):
builders.append(builder)
return builders

17
config/builders/test_c.py Normal file
View File

@@ -0,0 +1,17 @@
from buildbot.plugins import steps, util
factory = util.BuildFactory()
factory.addStep(steps.Git(repourl='https://git.blackfinn.de/tkl/test.c.git', mode='full'))
factory.addStep(steps.ShellCommand(command=['make', 'check', '-j8']))
factory.addStep(steps.Compile(command=['make', 'all', '-j8']))
factory.addStep(steps.ShellCommand(command=['make', 'build_unit_test', '-j8']))
factory.addStep(steps.ShellCommand(command=['make', 'exec_unit_test']))
factory.addStep(steps.ShellCommand(command='make clean && make coverage'))
builder = util.BuilderConfig(name='test.c', workernames=["buildbot-cpp-worker"],
factory=factory)
def append(builders):
builders.append(builder)
return builders

View File

@@ -0,0 +1,29 @@
from buildbot.plugins import steps, util
factory = util.BuildFactory()
# dependencies
factory.addStep(steps.ShellCommand(command=['git', 'clone', '--branch', 'master',
'https://git.blackfinn.de/adc_gpio_i2c/i2c_bb.git']))
factory.addStep(steps.ShellCommand(command=['make', '-C', 'i2c_bb', 'install', '-j8', 'PREFIX=/worker']))
factory.addStep(steps.ShellCommand(command=['git', 'clone', '--branch', 'master',
'https://git.blackfinn.de/adc_gpio_i2c/ads1115.git']))
factory.addStep(steps.ShellCommand(command=['make', '-C', 'ads1115', 'install', '-j8', 'PREFIX=/worker']))
# DUT
factory.addStep(steps.ShellCommand(command=['git', 'clone', '--branch', 'master',
'https://git.blackfinn.de/adc_gpio_i2c/voltage_app.git']))
factory.addStep(steps.ShellCommand(command=['make', '-C', 'voltage_app', 'check', '-j8']))
factory.addStep(steps.ShellCommand(command=['make', '-C', 'voltage_app', 'all', '-j8',
'EXTRA_INC=/worker/include', 'EXTRA_LIB_DIR=/worker/lib']))
#factory.addStep(steps.ShellCommand(command=['make', '-C', 'voltage_app', 'build_unit_test', '-j8']))
#factory.addStep(steps.ShellCommand(command=['make', '-C', 'voltage_app', 'exec_unit_test']))
#factory.addStep(steps.ShellCommand(command='make -C voltage_app clean && make -C voltage_app coverage'))
builder = util.BuilderConfig(name='voltage_app', workernames=["buildbot-cpp-worker"],
factory=factory)
def append(builders):
builders.append(builder)
return builders

49
config/change_sources.py Normal file
View File

@@ -0,0 +1,49 @@
from buildbot.plugins import changes
cs_test_c = changes.GitPoller(project='test.c',
repourl='https://git.blackfinn.de/tkl/test.c.git',
branches=True, pollInterval=300)
## gpio_ftdi
cs_gpio_ftdi = changes.GitPoller(project='gpio_ftdi',
repourl='https://git.blackfinn.de/adc_gpio_i2c/gpio_ftdi.git',
branches=True, pollInterval=60)
## gpio_sys
cs_gpio_sys = changes.GitPoller(project='gpio_sys',
repourl='https://git.blackfinn.de/adc_gpio_i2c/gpio_sys.git',
branches=True, pollInterval=60)
## i2c_bb
cs_i2c_bb = changes.GitPoller(project='i2c_bb',
repourl='https://git.blackfinn.de/adc_gpio_i2c/i2c_bb.git',
branches=True, pollInterval=60)
## ads1115
cs_ads1115 = changes.GitPoller(project='ads1115',
repourl='https://git.blackfinn.de/adc_gpio_i2c/ads1115.git',
branches=True, pollInterval=60)
## voltage_app
cs_voltage_app = changes.GitPoller(project='voltage_app',
repourl='https://git.blackfinn.de/adc_gpio_i2c/voltage_app.git',
branches=True, pollInterval=60)
## bicycle-statistics
cs_bicycle_python = changes.GitPoller(project='bicycle-statistics-python',
repourl='https://git.blackfinn.de/python/bicycle-statistics.git',
branches=True, pollInterval=60)
cs_bicycle_docker = changes.GitPoller(project='bicycle-statistics-docker',
repourl='https://git.blackfinn.de/docker/bicycle-statistics.git',
branches=True, pollInterval=60)
def append(change_sources):
change_sources.append(cs_test_c)
change_sources.append(cs_gpio_ftdi)
change_sources.append(cs_gpio_sys)
change_sources.append(cs_i2c_bb)
change_sources.append(cs_ads1115)
change_sources.append(cs_voltage_app)
change_sources.append(cs_bicycle_python)
change_sources.append(cs_bicycle_docker)
return change_sources

63
config/schedulers.py Normal file
View File

@@ -0,0 +1,63 @@
from buildbot.plugins import schedulers, util
sched_a1 = schedulers.SingleBranchScheduler(name="test_c",
change_filter=util.ChangeFilter(project='test.c'),
treeStableTimer=None, builderNames=["test.c"])
sched_a2 = schedulers.ForceScheduler(name="force_test_c", builderNames=["test.c"])
sched_b1 = schedulers.SingleBranchScheduler(name="gpio_ftdi",
change_filter=util.ChangeFilter(project='gpio_ftdi'),
treeStableTimer=None, builderNames=["gpio_ftdi"])
sched_b2 = schedulers.ForceScheduler(name="force_gpio_ftdi", builderNames=["gpio_ftdi"])
sched_c1 = schedulers.SingleBranchScheduler(name="gpio_sys",
change_filter=util.ChangeFilter(project='gpio_sys'),
treeStableTimer=None, builderNames=["gpio_sys"])
sched_c2 = schedulers.ForceScheduler(name="force_gpio_sys", builderNames=["gpio_sys"])
sched_d1 = schedulers.SingleBranchScheduler(name="i2c_bb",
change_filter=util.ChangeFilter(project='i2c_bb'),
treeStableTimer=None, builderNames=["i2c_bb"])
sched_d2 = schedulers.ForceScheduler(name="force_i2c_bb", builderNames=["i2c_bb"])
sched_e1 = schedulers.SingleBranchScheduler(name="ads1115",
change_filter=util.ChangeFilter(project=['i2c_bb', 'ads1115']),
treeStableTimer=None, builderNames=["ads1115"])
sched_e2 = schedulers.ForceScheduler(name="force_ads1115", builderNames=["ads1115"])
sched_f1 = schedulers.SingleBranchScheduler(name="voltage_app",
change_filter=util.ChangeFilter(project=['voltage_app',
'ads1115',
'i2c_bb']),
treeStableTimer=None, builderNames=["voltage_app"])
sched_f2 = schedulers.ForceScheduler(name="force_voltage_app", builderNames=["voltage_app"])
sched_g1 = schedulers.SingleBranchScheduler(name="bicycle_statistics",
change_filter=util.ChangeFilter(project=['bicycle-statistics-python',
'bicycle-statistics-docker']),
treeStableTimer=None, builderNames=["bicycle_statistics"])
sched_g2 = schedulers.ForceScheduler(name="force_bicycle-statistics", builderNames=["bicycle_statistics"])
def append(schedulers):
schedulers.append(sched_a1)
schedulers.append(sched_a2)
schedulers.append(sched_b1)
schedulers.append(sched_b2)
schedulers.append(sched_c1)
schedulers.append(sched_c2)
schedulers.append(sched_d1)
schedulers.append(sched_d2)
schedulers.append(sched_e1)
schedulers.append(sched_e2)
schedulers.append(sched_f1)
schedulers.append(sched_f2)
schedulers.append(sched_g1)
schedulers.append(sched_g2)
return schedulers

16
config/workers.py Normal file
View File

@@ -0,0 +1,16 @@
from buildbot.plugins import worker
cpp_worker = worker.DockerLatentWorker('buildbot-cpp-worker', 'pass',
docker_host='tcp://192.168.178.39:2375',
image='buildbot-cpp-worker')
docker_worker = worker.DockerLatentWorker('buildbot-docker-worker', 'pass',
docker_host='tcp://192.168.178.39:2375',
image='buildbot-docker-worker',
volumes=['/var/run/docker.sock:/var/run/docker.sock'])
def append(workers):
workers.append(cpp_worker)
workers.append(docker_worker)
return workers