master-cfg/config/builders/beaglebone_yocto.py

51 lines
2.3 KiB
Python
Raw Normal View History

2019-12-01 17:52:35 +01:00
from buildbot.plugins import changes, schedulers, steps, util, worker
REPOURL_MANIFEST = 'https://git.blackfinn.de/yocto/linux-blackfinn.git'
REPOURL_META_BLACKFINN = 'https://git.blackfinn.de/yocto/meta-blackfinn.git'
BRANCH = util.Property('branch', default='master')
COMMANDS = []
COMMANDS.append(['repo', 'init', '-u', REPOURL_MANIFEST])
COMMANDS.append(['repo', 'sync'])
COMMANDS.append(['bash', '-c', 'MACHINE=beaglebone-yocto source blackfinn-init-build-env; bitbake console-image'])
COMMANDS.append(['bash', '-c', 'MACHINE=beaglebone-yocto source blackfinn-init-build-env; bitbake console-dev-image'])
# Change sources
cs_linux_yocto = changes.GitPoller(project='linux-yocto', repourl=REPOURL_MANIFEST, branches=True, pollInterval=60)
cs_meta_bf = changes.GitPoller(project='meta-blackfinn', repourl=REPOURL_META_BLACKFINN, branches=True, pollInterval=60)
# Factory
factory = util.BuildFactory()
for cmd in COMMANDS:
factory.addStep(steps.ShellCommand(command=cmd))
# Worker
beaglebone_yocto_worker = worker.DockerLatentWorker('buildbot-oe-worker', 'pass',
docker_host='tcp://192.168.178.39:2375',
image='buildbot-oe-worker',
volumes=['/var/run/docker.sock:/var/run/docker.sock'])
# Builder
beaglebone_yocto_builder = util.BuilderConfig(name='beaglebone_yocto_builder',
workernames=["buildbot-oe-worker"],
factory=factory)
# Schedulers
change_scheduler = schedulers.SingleBranchScheduler(name="beaglebone-yocto",
change_filter=util.ChangeFilter(project=['linux-yocto', 'meta-blackfinn']),
treeStableTimer=None, builderNames=["beaglebone_yocto_builder"])
force_scheduler = schedulers.ForceScheduler(name="force_beaglebone-yocto", builderNames=["beaglebone_yocto_builder"])
def append(c):
c['change_source'].append(cs_linux_yocto)
c['change_source'].append(cs_meta_bf)
c['workers'].append(beaglebone_yocto_worker)
c['builders'].append(beaglebone_yocto_builder)
c['schedulers'].append(change_scheduler)
c['schedulers'].append(force_scheduler)
return c