# -*- python -*-
# ex: set syntax=python:

from buildbot.plugins import *
from buildbot.plugins import buildslave, 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 = {}

quaggagit = 'git://git.sv.gnu.org/quagga.git'

# password defs
execfile("pass.cfg")

workers = {
	"fedora-24": { 
	  "os": "Fedora",
	  "version": "24",
	  "vm": False,
	  "pkg": "rpm",
	}, 
	"centos-7": {
	  "os": "CentOS",
	  "version": "7",
	  "vm": False,
	  "pkg": "rpm",
	},
	"debian-8": {
	  "os": "Debian",
	  "version": "8",
	  "vm": True,	
  	  "pkg": "dpkg",
  	  "latent": True,
  	  "hd_image": "/var/lib/libvirt/images/debian8.qcow2",
  	},
  	"debian-9": { 
	  "os": "Debian",
	  "version": "9",
	  "vm": True,	
  	  "pkg": "dpkg",
  	  "latent": True,
  	  "hd_image": "/var/lib/libvirt/images/debian9.qcow2",
  	},
  	"freebsd-10": { 
	  "os": "FreeBSD",
	  "version": "10",
	  "vm": True,	
  	  "pkg": "",
  	  "latent": True,
  	  "hd_image": "/var/lib/libvirt/images/freebsd103.qcow2",
  	}, 
  	"freebsd-11": { 
	  "os": "FreeBSD",
	  "version": "11",
	  "vm": True,	
  	  "pkg": "",
  	  "latent": True,
  	  "hd_image": "/var/lib/libvirt/images/freebsd110.qcow2",
  	},
  	"oi-hipster": {
  	  "os": "OpenIndiana",
  	  "version": "hipster",
  	  "vm": True,
  	  "pkg": "sysv",
	  "latent": True,
	  "hd_image": "/var/lib/libvirt/images/buildbot-oi-hipster.qcow2",
  	},
}

# ensure "latent" is set to false, where not set.
# add in the passwords
for kw in workers:
	w = workers[kw]
	w["bot"] = "buildbot-" + kw
	if "latent" not in w:
		w["latent"] = False
	w["pass"] = workers_pass[kw]

analyses_builders = [ "clang-analyzer" ]

# default Libvirt session
for w in (w for w in workers.values () if ("latent" in w) 
					and ("session" not in w)):
	w["session"] = 'qemu+ssh://buildbot@sagan.jakma.org/system'

osbuilders = ["build-" + kw for kw in workers]
osfastbuilders = ["build-" + kw for kw in workers if workers[kw]["vm"] == False]
osslowbuilders = ["build-" + kw for kw in workers if workers[kw]["vm"] == True]

rpmbuilders = ["rpm-" + kw for kw in workers if workers[kw]["pkg"] == "rpm"]

allbuilders =  []
allbuilders += osbuilders
allbuilders += rpmbuilders
allbuilders += analyses_builders
allbuilders += ["commit-builder"]
allbuilders += ["build-distcheck"]

# Force merging of requests.
# c['mergeRequests'] = lambda *args, **kwargs: True

####### BUILDSLAVES
c['slaves'] = []

# The 'slaves' list defines the set of recognized buildslaves. Each element is
# a BuildSlave object, specifying a unique slave name and password.  The same
# slave name and password must be configured on the slave.

for w in (w for w in workers.values() if ("latent" not in w)
				      or (w["latent"] == False)):
	c['slaves'].append(buildslave.BuildSlave(w["bot"], w["pass"]))

for w in (w for w in workers.values()
		  if ("latent" in w) 
		     and w["latent"]
		     and "hd_image" in w):
	c['slaves'].append(buildslave.LibVirtSlave(
					w["bot"],
					w["pass"],
					util.Connection(w["session"]),
					w["hd_image"],
	))

# 'protocols' contains information about protocols which master will use for
# communicating with slaves.
# You must define at least 'port' option that slaves could connect to your master
# with this protocol.
# 'port' must match the value configured into the buildslaves (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 clone of pyflakes.

c['change_source'] = []
c['change_source'].append(changes.GitPoller(
	quaggagit,
        workdir='gitpoller-workdir', 
	branches=['master','volatile/next'],
        pollinterval=300))

####### SCHEDULERS

# Configure the Schedulers, which decide how to react to incoming changes. 

# We want a first line of 'quick' builds, which then trigger further builds.
#
# A control-flow builder, "commit-builder", used to sequence the 'real'
# sets of builders, via Triggers.

c['schedulers'] = []
c['schedulers'].append(schedulers.SingleBranchScheduler(
                            name="master-change",
                            change_filter=util.ChangeFilter(branch='master'),
                            treeStableTimer=10,
                            builderNames=[ "commit-builder" ]))

c['schedulers'].append(schedulers.SingleBranchScheduler(
                            name="next-change",
                            change_filter=util.ChangeFilter(
                            	branch='volatile/next'),
                            treeStableTimer=10,
                            builderNames=[ "commit-builder" ] ))

# Initial build checks on faster, non-VM
c['schedulers'].append(schedulers.Triggerable(
	name="trigger-build-first",
	builderNames=osfastbuilders))

# Build using remaining builders, after firstbuilders.
c['schedulers'].append(schedulers.Triggerable(
	name="trigger-build-rest",
	builderNames=osslowbuilders))

# Analyses tools, e.g. CLang Analyzer scan-build
c['schedulers'].append(schedulers.Triggerable(
		       name="trigger-build-analyses",	
		       builderNames=analyses_builders))
# Dist check
c['schedulers'].append(schedulers.Triggerable(
		       name="trigger-distcheck",	
		       builderNames=["build-distcheck"]))
# RPM check and build
c['schedulers'].append(schedulers.Triggerable(
		       name="trigger-rpm",	
		       builderNames=rpmbuilders))

# Try and force schedulers
c['schedulers'].append(schedulers.ForceScheduler(
                       name="force",
                       builderNames=allbuilders))

c['schedulers'].append(schedulers.Try_Userpass(
		       name="try",
		       builderNames=osbuilders
		       		    + rpmbuilders
				    + ["build-distcheck", 
					 "clang-analyzer" ],
			userpass=users,
			port=8031))

####### BUILDERS
c['builders'] = []

# The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
# what steps, and which slaves can execute them.  Note that any particular build will
# only take place on one slave.

common_steps = [
steps.Git(repourl=quaggagit, mode='incremental'),
steps.ShellCommand(command=["./update-autotools"]),
steps.Configure(),
steps.ShellCommand(command=["make", "clean"]),
steps.Compile(),
]

### Default 'check' build, builder instantiated for each OS

factory = util.BuildFactory()
# check out the source
factory.addStep(steps.Git(repourl=quaggagit, mode='incremental'))
factory.addStep(steps.ShellCommand(command=["./update-autotools"],
				   description="generating autoconf",
				   descriptionDone="autoconf"))
factory.addStep(steps.Configure())
factory.addStep(steps.ShellCommand(command=["make", "clean"],
				   description="cleaning",
				   descriptionDone="clean"))
factory.addStep(steps.Compile(command=["make", "-j", "2", "all"]))
factory.addStep(steps.ShellCommand(command=["make", "check"],
				   description="checking",
				   descriptionDone="make check"))

# create builder for every OS, for every buildbot
# XXX: at moment this assumes 1:1 OS<->bot
for kw in workers:
   c['builders'].append(util.BuilderConfig(
	name="build-" + kw,
	slavenames=workers[kw]["bot"],
	factory=factory))

### distcheck Builder, executed on any available bot
factory = util.BuildFactory()
# check out the source
factory.addStep(steps.Git(repourl=quaggagit, mode='incremental'))
factory.addStep(steps.ShellCommand(command=["./update-autotools"],
				   description="generating autoconf",
				   descriptionDone="autoconf"))
factory.addStep(steps.Configure())
factory.addStep(steps.ShellCommand(command=["make", "clean"],
				   description="cleaning",
				   descriptionDone="make clean"))
factory.addStep(steps.ShellCommand(command=["make", "distcheck"],
				   description="run make distcheck",
				   descriptionDone="make distcheck"))
c['builders'].append(
	util.BuilderConfig(name="build-distcheck",
	slavenames=list(w["bot"] for w in workers.values()),
	factory=factory,
))

### LLVM clang-analyzer build, executed on any available non-VM bot

f = util.BuildFactory()
# check out the source
f.addStep(steps.Git(repourl=quaggagit, mode='incremental',
		    getDescription=True))
f.addStep(steps.ShellCommand(command=["./update-autotools"],
			     description="run autotools",
			     descriptionDone="autoconf"))
f.addStep(steps.Configure())
f.addStep(steps.ShellCommand(command=["make", "clean"],
			     description="cleaning",
			     descriptionDone="make clean"))

f.addStep(steps.SetProperty(property="clang-id",
	value=util.Interpolate("%(prop:commit-description)s-%(prop:buildnumber)s")))

f.addStep(steps.SetProperty(property="clang-output-dir",
	value=util.Interpolate("../CLANG-%(prop:clang-id)s")))
f.addStep(steps.SetProperty(property="clang-uri",
	value=util.Interpolate("/clang-analyzer/%(prop:clang-id)s")))
# relative to buildbot master working directory
f.addStep(steps.SetProperty(property="clang-upload-dir",
	value=util.Interpolate("public_html/clang-analyzer/%(prop:clang-id)s")))

f.addStep(steps.Compile(command=["scan-build",
			      	 "-analyze-headers",
			      	 "-o",
			      	 util.Interpolate("%(prop:clang-output-dir)s"),
				 "make", "-j", "all"]))
f.addStep(steps.DirectoryUpload(
	  slavesrc=util.Interpolate("%(prop:clang-output-dir)s"),
	  masterdest = util.Interpolate("%(prop:clang-upload-dir)s"),
	  compress = 'bz2',
	  name = "clang report",
	  url = util.Interpolate("%(prop:clang-uri)s"),
))
f.addStep(steps.RemoveDirectory(
	dir=util.Interpolate("%(prop:clang-output-dir)s")
))


c['builders'].append(
    util.BuilderConfig(name="clang-analyzer",
      slavenames=list(w["bot"] for w in workers.values() if not w["vm"]),
      factory=f))


### RPM: check and build
f = util.BuildFactory ()

# check out the source
f.addStep(steps.Git(repourl=quaggagit, mode='full'))
f.addStep(steps.ShellCommand(command=["./update-autotools"],
				   description="run autotools",
				   descriptionDone="autotools"))
f.addStep(steps.Configure())
f.addStep(steps.ShellCommand(command=["make", "dist"],
				     description="run make dist",
				     descriptionDone="make dist"))
# not imported somehow
#f.addStep(steps.RpmLint(fileloc="redhat/quagga.spec"))
f.addStep(steps.ShellCommand(command=["rpmlint", "-i", "redhat/quagga.spec"],
				description="run rpmlint",
				descriptionDone="rpmlint"))
f.addStep(steps.RpmBuild(specfile="redhat/quagga.spec"))
#			 rpmdir=util.Interpolate("%(prop:builddir)s/rpm")))

# XXX: assuming 1:1 OS:buildbot mapping
for kw in (kw for kw in workers if workers[kw]["pkg"] == "rpm"):
	c['builders'].append(
    		util.BuilderConfig(name="rpm-" + kw,
      				   slavenames="buildbot-" + kw,
      				   factory=f
      		)
      	)

### Co-ordination builds used to sequence parallel builds via Triggerable

# to understand this you have to read this list and the Triggered schedulers
# to see what sets of builds are being sequenced. Bit clunky, but Buildbot
# doesn't have a way to just specify a pipeline of groups of builders more
# cleanly.

f = util.BuildFactory()
f.addStep(steps.Trigger (
	schedulerNames = [ "trigger-build-first" ],
	waitForFinish=True,
	updateSourceStamp=True
))
f.addStep(steps.Trigger (
	schedulerNames = [ "trigger-build-rest" ],
	waitForFinish=True,
	updateSourceStamp=True
))
f.addStep(steps.Trigger (
	schedulerNames = [ "trigger-build-analyses", "trigger-distcheck" ],
	waitForFinish=True,
	updateSourceStamp=True
))
f.addStep(steps.Trigger (
	schedulerNames = [ "trigger-rpm" ],
	waitForFinish=True,
	updateSourceStamp=True
))

c['builders'].append(
    util.BuilderConfig(name="commit-builder",
      slavenames=[w["bot"] for w in workers.values() if not w["vm"]],
      factory=f)
)


####### STATUS TARGETS

# 'status' is a list of Status Targets. The results of each build will be
# pushed to these targets. buildbot/status/*.py has a variety to choose from,
# including web pages, email senders, and IRC bots.

c['status'] = []

from buildbot.status import html
from buildbot.status.web import authz, auth

authz_cfg=authz.Authz(
    # change any of these to True to enable; see the manual for more
    # options
    #auth=auth.BasicAuth([("pyflakes","pyflakes")]),
    auth=util.BasicAuth(users),
    gracefulShutdown = False,
    forceBuild = 'auth', # use this to test your slave once it is set up
    forceAllBuilds = 'auth',  # ..or this
    pingBuilder = 'auth',
    stopBuild = 'auth',
    stopAllBuilds = 'auth',
    cancelPendingBuild = 'auth',
    cancelAllPendingBuilds = 'auth',
    pauseSlave = 'auth',    
)
c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))

c['status'].append(status.MailNotifier(
	fromaddr="buildbot@quagga.net",
	extraRecipients=["paul@jakma.org"],
	sendToInterestedUsers=False,
))

c['status'].append (status.IRC(
	"irc.freenode.net", "bb-quagga",
	useColors=True,
	channels=[{"channel": "#quagga"}],
	notify_events={
		'exception': 1,
		'successToFailure': 1,
		'failureToSuccess': 1,
	},
))

####### PROJECT IDENTITY

# the 'title' string will appear at the top of this buildbot
# installation's html.WebStatus home page (linked to the
# 'titleURL') and is embedded in the title of the waterfall HTML page.

c['title'] = "Quagga"
c['titleURL'] = "https://www.quagga.net/"

# the 'buildbotURL' string should point to the location where the buildbot's
# internal web server (usually the html.WebStatus page) is visible. This
# typically uses the port number set in the Waterfall 'status' entry, but
# with an externally-visible host name which the buildbot cannot figure out
# without some help.

c['buildbotURL'] = "http://buildbot.quagga.net/"

####### 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",
}

#### debug
c['debugPassword'] = debugPassword
