2017-10-24 21:27:52 +02:00
|
|
|
# -*- python -*-
|
|
|
|
# ex: set filetype=python:
|
|
|
|
|
|
|
|
from buildbot.plugins import *
|
2017-10-25 16:59:41 +02:00
|
|
|
from buildbot.process.results import SUCCESS
|
2017-10-24 21:27:52 +02:00
|
|
|
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'] = [
|
2017-10-25 16:25:12 +02:00
|
|
|
worker.DockerLatentWorker('f27', 'work3rP@ss!',
|
|
|
|
docker_host='unix:///var/run/docker.sock',
|
|
|
|
image='buildbot-worker:27',
|
2018-01-10 18:06:37 +01:00
|
|
|
hostconfig={'cap_add': ['SYS_ADMIN'], 'security_opt': ['apparmor=unconfined']}),
|
2018-06-21 09:56:38 +02:00
|
|
|
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']}),
|
2018-10-24 10:41:20 +02:00
|
|
|
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']}),
|
2017-10-24 21:27:52 +02:00
|
|
|
]
|
|
|
|
# '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"]))
|
2017-10-25 16:25:12 +02:00
|
|
|
c['schedulers'].append(schedulers.ForceScheduler(
|
|
|
|
name="Force_QGIS_DNF_F27",
|
|
|
|
builderNames=["qgis_dnf_f27"]))
|
2018-06-21 09:56:38 +02:00
|
|
|
c['schedulers'].append(schedulers.ForceScheduler(
|
|
|
|
name="Force_QGIS_DNF_F28",
|
|
|
|
builderNames=["qgis_dnf_f28"]))
|
2018-10-24 10:41:20 +02:00
|
|
|
c['schedulers'].append(schedulers.ForceScheduler(
|
|
|
|
name="Force_QGIS_DNF_F29",
|
|
|
|
builderNames=["qgis_dnf_f29"]))
|
2017-10-24 21:27:52 +02:00
|
|
|
|
|
|
|
####### 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")],
|
2017-10-25 09:36:11 +02:00
|
|
|
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"],
|
2017-10-25 16:25:12 +02:00
|
|
|
name="Add COPR"))
|
2017-10-25 09:36:11 +02:00
|
|
|
qgis_install_factory.addStep(steps.ShellCommand(command=["/usr/bin/sudo", "dnf", "install", "--refresh", "-y", "qgis",
|
|
|
|
"python3-qgis", "qgis-server", "qgis-grass"],
|
2017-10-25 16:25:12 +02:00
|
|
|
name="Run DNF"))
|
2017-10-25 16:59:41 +02:00
|
|
|
qgis_install_factory.addStep(steps.ShellCommand(command=["/usr/bin/qgis", "--help"],
|
|
|
|
name="Run QGIS", decodeRC={0:SUCCESS, 2:SUCCESS}))
|
2017-10-24 21:27:52 +02:00
|
|
|
|
|
|
|
# th_factory = util.BuildFactory() # dummy
|
|
|
|
|
|
|
|
c['builders'] = []
|
|
|
|
c['builders'].append(
|
|
|
|
util.BuilderConfig(name="qgis",
|
2018-06-21 09:56:38 +02:00
|
|
|
workernames=["f28"],
|
2017-10-24 21:27:52 +02:00
|
|
|
factory=qgis_factory))
|
2018-10-24 10:41:20 +02:00
|
|
|
c['builders'].append(
|
|
|
|
util.BuilderConfig(name="qgis_dnf_f29",
|
|
|
|
workernames=["f29"],
|
|
|
|
factory=qgis_install_factory))
|
2017-10-25 09:36:11 +02:00
|
|
|
c['builders'].append(
|
2018-06-21 09:56:38 +02:00
|
|
|
util.BuilderConfig(name="qgis_dnf_f28",
|
|
|
|
workernames=["f28"],
|
2017-10-25 16:25:12 +02:00
|
|
|
factory=qgis_install_factory))
|
|
|
|
c['builders'].append(
|
|
|
|
util.BuilderConfig(name="qgis_dnf_f27",
|
|
|
|
workernames=["f27"],
|
2017-10-25 09:36:11 +02:00
|
|
|
factory=qgis_install_factory))
|
2017-10-24 21:27:52 +02:00
|
|
|
|
|
|
|
####### 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),
|
2018-10-24 10:41:20 +02:00
|
|
|
# if future Buildbot implement new control, we are safe with this last rule
|
2017-10-24 21:27:52 +02:00
|
|
|
],
|
|
|
|
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",
|
|
|
|
}
|