master-cfg/config/builders/beaglebone_yocto.py
Thomas Klaehn 0769741a64 config: Restructured
Signed-off-by: Thomas Klaehn <thomas.klaehn@perinet.io>
2020-09-29 15:44:16 +02:00

52 lines
2.4 KiB
Python

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; echo "DL_DIR ?= \\"/yocto/downloads\\"" >> conf/local.conf; echo "SSTATE_DIR ?= \\"/yocto/sstate-cache\\"" >> conf/local.conf; cat conf/local.conf; bitbake docker-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-worker-openembedded', 'pass',
docker_host='tcp://192.168.178.82:2375',
image='buildbot-worker-openembedded',
volumes=['/var/run/docker.sock:/var/run/docker.sock',
'/srv/yocto/sstate-cache:/yocto/sstate-cache',
'/srv/yocto/downloads:/yocto/downloads'])
# Builder
beaglebone_yocto_builder = util.BuilderConfig(name='beaglebone_yocto',
workernames=["buildbot-worker-openembedded"],
factory=factory)
# Schedulers
change_scheduler = schedulers.SingleBranchScheduler(name="beaglebone-yocto",
change_filter=util.ChangeFilter(project=['linux-yocto', 'meta-blackfinn']),
treeStableTimer=None, builderNames=["beaglebone_yocto"])
force_scheduler = schedulers.ForceScheduler(name="force_beaglebone-yocto", builderNames=["beaglebone_yocto"])
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