import re from buildbot.steps.source.git import Git from buildbot.steps.shell import ShellCommand from buildbot.plugins import (reporters, worker, changes, schedulers, util) # 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 = {} # Silence warning and allow very basic phoning home. c["buildbotNetUsageData"] = "basic" ####### 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("demo-checker", "demo-pass")] # '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": "tcp:9989:interface=127.0.0.1"}} ####### CHANGESOURCES # the 'change_source' setting tells the buildmaster how it should # find out about source code changes. # No need for change sources. ####### SCHEDULERS # Configure the Schedulers, which decide how to react to incoming # changes. DEMO_SERVICES_CHECKER_SCHEDULER = schedulers.Periodic( name="demo-check-scheduler", periodicBuildTimer=60*30, # 1/2 hour builderNames=["demo-check-builder"]) # Provide "force" button in the web UI. To be removed in the # future ? FORCE_SCHEDULER = schedulers.ForceScheduler( name="force-scheduler", builderNames=[ "demo-check-builder"]) c["schedulers"] = [ DEMO_SERVICES_CHECKER_SCHEDULER, FORCE_SCHEDULER] ####### 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. DEMO_SERVICES_CHECKER_FACTORY = util.BuildFactory() DEMO_SERVICES_CHECKER_FACTORY.addStep(ShellCommand( name="demo services checker", description="Checking demo services are online", descriptionDone="Demo services are online!.", # a symlink to a nonupdated deployment checkout. command=["/home/demo/demo-oldchecks.sh"], workdir="build/buildbot", haltOnFailure=True)) DEMO_SERVICES_CHECKER_BUILDER = util.BuilderConfig( name="demo-check-builder", workernames="demo-checker", factory=DEMO_SERVICES_CHECKER_FACTORY) c["builders"] = [ DEMO_SERVICES_CHECKER_BUILDER] ####### 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. ## # Currently not used. def message_formatter(mode, name, build, results, master_status): logs = list() for line in build.getLogs(): logs.append(line.getText().splitlines()) return { "body": "\n".join(logs), "type": "plain"} EMAIL = reporters.MailNotifier( fromaddr="noreply-demochecks@taler.net", sendToInterestedUsers=False, # notify from pass to fail, and viceversa. mode=("change"), builders=("demo-check-builder"), extraRecipients=["demo-feedback@taler.net"], subject="Demo state changed.") c["services"] = [EMAIL] ####### PROJECT IDENTITY c["title"] = "Taler" c["titleURL"] = "https://taler.net" # We use nginx to expose the BB under this URL. c["buildbotURL"] = "https://buildbot.taler.net/" from taler_bb_userpass_db import USER_PASSWORD_DB BUILDER_LIST = ["demo-check-builder"] authz = util.Authz( allowRules=[ util.ForceBuildEndpointMatcher( role="admins", builder=b) for b in BUILDER_LIST] + [util.StopBuildEndpointMatcher( role="admins", builder=b) for b in BUILDER_LIST] + [util.RebuildBuildEndpointMatcher( role="admins", builder=b) for b in BUILDER_LIST] + [util.ForceBuildEndpointMatcher( role="norole", builder=b) for b in BUILDER_LIST] + [util.StopBuildEndpointMatcher( role="norole", builder=b) for b in BUILDER_LIST] + [util.RebuildBuildEndpointMatcher( role="norole", builder=b) for b in BUILDER_LIST], roleMatchers=[ util.RolesFromUsername(roles=["admins"], usernames=["marcello", "florian", "christian"])]) # minimalistic config to activate new web UI c["www"] = { "port": 8010, "plugins" : { "waterfall_view": {}, "console_view":{}}, "allowed_origins": ["https://*.taler.net"], "avatar_methods": [], "auth": util.UserPasswordAuth(USER_PASSWORD_DB), "authz": authz} ####### 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", }