1
0
mirror of https://github.com/daniviga/qgis3-cd-copr.git synced 2024-11-23 01:46:13 +01:00
qgis3-cd-copr/buildbot/master.cfg
2018-10-24 10:41:20 +02:00

174 lines
7.4 KiB
Python

# -*- python -*-
# ex: set filetype=python:
from buildbot.plugins import *
from buildbot.process.results import SUCCESS
from buildbot.process.properties import Property
# This is a sample buildmaster config file. It must be installed as
# 'master.cfg' in your buildmaster's base directory.
# This is the dictionary that the buildmaster pays attention to. We also use
# a shorter alias to save typing.
c = BuildmasterConfig = {}
####### WORKERS
# The 'workers' list defines the set of recognized workers. Each element is
# a Worker object, specifying a unique worker name and password. The same
# worker name and password must be configured on the worker.
#c['workers'] = [worker.Worker("worker", "work3rP@ss!")]
c['workers'] = [
worker.DockerLatentWorker('f27', 'work3rP@ss!',
docker_host='unix:///var/run/docker.sock',
image='buildbot-worker:27',
hostconfig={'cap_add': ['SYS_ADMIN'], 'security_opt': ['apparmor=unconfined']}),
worker.DockerLatentWorker('f28', 'work3rP@ss!',
docker_host='unix:///var/run/docker.sock',
image='buildbot-worker:28',
hostconfig={'cap_add': ['SYS_ADMIN'], 'security_opt': ['apparmor=unconfined']}),
worker.DockerLatentWorker('f29', 'work3rP@ss!',
docker_host='unix:///var/run/docker.sock',
image='buildbot-worker:29',
hostconfig={'cap_add': ['SYS_ADMIN'], 'security_opt': ['apparmor=unconfined']}),
]
# 'protocols' contains information about protocols which master will use for
# communicating with workers. You must define at least 'port' option that workers
# could connect to your master with this protocol.
# 'port' must match the value configured into the workers (with their
# --master option)
c['protocols'] = {'pb': {'port': 9989}}
####### CHANGESOURCES
# the 'change_source' setting tells the buildmaster how it should find out
# about source code changes. Here we point to the buildbot version of a python hello-world project.
c['change_source'] = []
# FIXME
# c['change_source'].append(changes.GitPoller(
# 'git://github.com/buildbot/hello-world.git',
# workdir='gitpoller-workdir', branch='master',
# pollinterval=300))
#
####### SCHEDULERS
# Configure the Schedulers, which decide how to react to incoming changes. In this
# case, just kick off a 'qgis' build
c['schedulers'] = []
# FIXME
# c['schedulers'].append(schedulers.SingleBranchScheduler(
# name="all",
# change_filter=util.ChangeFilter(branch='master'),
# treeStableTimer=None,
# builderNames=["qgis"]))
c['schedulers'].append(schedulers.ForceScheduler(
name="Force_QGIS",
builderNames=["qgis"]))
c['schedulers'].append(schedulers.ForceScheduler(
name="Force_QGIS_DNF_F27",
builderNames=["qgis_dnf_f27"]))
c['schedulers'].append(schedulers.ForceScheduler(
name="Force_QGIS_DNF_F28",
builderNames=["qgis_dnf_f28"]))
c['schedulers'].append(schedulers.ForceScheduler(
name="Force_QGIS_DNF_F29",
builderNames=["qgis_dnf_f29"]))
####### BUILDERS
# The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
# what steps, and which workers can execute them. Note that any particular build will
# only take place on one worker.
def rpm_name(rc, stdout, stderr):
return stdout.split()[3]
qgis_factory = util.BuildFactory()
qgis_factory.addStep(steps.Git(repourl=Property('repository', 'git://github.com/qgis/qgis.git'), mode='full',
method='clobber', shallow=True, name="Clone"))
qgis_factory.addStep(steps.ShellCommand(command=["./buildrpms.sh", "-s", "-u"],
workdir="build/rpm", name="Build SRPM", env={"_MOCK_OLD_CHROOT": "true"}))
qgis_factory.addStep(steps.ShellCommand(command="ls", workdir="build/rpm/result", name="List artifacts"))
qgis_factory.addStep(steps.SetPropertyFromCommand(command="ls qgis*.src.rpm", property="srpm",
workdir="build/rpm/result", name="Get artifacts"))
qgis_factory.addStep(steps.ShellCommand(command=["copr-cli", "build", "qgis-testing", util.Interpolate("%(prop:srpm)s")],
workdir="build/rpm/result", timeout=28800, name="Build on COPR"))
qgis_install_factory = util.BuildFactory()
qgis_install_factory.addStep(steps.ShellCommand(command=["/usr/bin/sudo", "dnf", "copr", "enable", "-y", "dani/qgis-testing"],
name="Add COPR"))
qgis_install_factory.addStep(steps.ShellCommand(command=["/usr/bin/sudo", "dnf", "install", "--refresh", "-y", "qgis",
"python3-qgis", "qgis-server", "qgis-grass"],
name="Run DNF"))
qgis_install_factory.addStep(steps.ShellCommand(command=["/usr/bin/qgis", "--help"],
name="Run QGIS", decodeRC={0:SUCCESS, 2:SUCCESS}))
# th_factory = util.BuildFactory() # dummy
c['builders'] = []
c['builders'].append(
util.BuilderConfig(name="qgis",
workernames=["f28"],
factory=qgis_factory))
c['builders'].append(
util.BuilderConfig(name="qgis_dnf_f29",
workernames=["f29"],
factory=qgis_install_factory))
c['builders'].append(
util.BuilderConfig(name="qgis_dnf_f28",
workernames=["f28"],
factory=qgis_install_factory))
c['builders'].append(
util.BuilderConfig(name="qgis_dnf_f27",
workernames=["f27"],
factory=qgis_install_factory))
####### BUILDBOT SERVICES
# 'services' is a list of BuildbotService items like reporter targets. The
# status of each build will be pushed to these targets. buildbot/reporters/*.py
# has a variety to choose from, like IRC bots.
c['services'] = []
####### PROJECT IDENTITY
# the 'title' string will appear at the top of this buildbot installation's
# home pages (linked to the 'titleURL').
c['title'] = "Build Server"
c['titleURL'] = "https://build.server"
# the 'buildbotURL' string should point to the location where the buildbot's
# internal web server is visible. This typically uses the port number set in
# the 'www' entry below, but with an externally-visible host name which the
# buildbot cannot figure out without some help.
c['buildbotURL'] = "https://build.server"
# minimalistic config to activate new web UI
c['www'] = dict(port=8010,
plugins=dict(waterfall_view={}, console_view={}, grid_view={}))
c['www']['authz'] = util.Authz(
allowRules = [
util.AnyControlEndpointMatcher(role="admins", defaultDeny=True),
util.AnyEndpointMatcher(role="admins", defaultDeny=False),
# if future Buildbot implement new control, we are safe with this last rule
],
roleMatchers = [
util.RolesFromUsername(roles=['admins'], usernames=['<user>'])
]
)
c['www']['auth'] = util.UserPasswordAuth([('<user>','<password>')])
####### DB URL
c['db'] = {
# This specifies what database buildbot uses to store its state. You can leave
# this at its default for all but the largest installations.
'db_url' : "sqlite:///state.sqlite",
}