Skip to content

Instantly share code, notes, and snippets.

@achilles4828
Created August 27, 2020 23:50
Show Gist options
  • Save achilles4828/30029d89d34096b9777435ce8fdd2eff to your computer and use it in GitHub Desktop.
Save achilles4828/30029d89d34096b9777435ce8fdd2eff to your computer and use it in GitHub Desktop.
# -*- python -*-
# ex: set filetype=python:
'''
BUILDBOT Master Config for Chromium, WebkitGTK, and Firefox Builder
'''
from buildbot.plugins import *
from buildbot.changes.gitpoller import GitPoller
from buildbot.plugins import changes
c = BuildmasterConfig = {}
####### WORKERS ######
'''
Worker Types:
OS: Linux
1.) Nightly Builder: night
2.) Release-ASN : rel
3.) Debug-ASN : deb
'''
c['workers'] = [
worker.Worker("chromium-night", "password123"),
worker.Worker("chromium-rel", "password123"),
worker.Worker("chromium-deb", "password123"),
worker.Worker("firefox-night", "password123"),
worker.Worker("firefox-rel", "password123"),
worker.Worker("firefox-deb", "password123"),
worker.Worker("webkit-night", "password123"),
worker.Worker("webkit-rel", "password123"),
worker.Worker("webkti-deb", "password123")
]
###### PROTOCOLS #######
c['protocols'] = {'pb': {'port': 9989}}
####### CHANGESOURCES #####
'''
Poller Types:
OS: Linux
1.) Chrome: GitPoller
2.) Firefox: HgPoller
3.) Webkit: GitPoller
'''
# Chrome Poller
chrome_poller = GitPoller('https://chromium.googlesource.com/chromium/src', branch='master', workdir="~/source/chromium/src", pollInterval=604800)
# Firefox Poller
firefox_poller = changes.HgPoller(repourl='https://hg.mozilla.org/releases/mozilla-release/', branch='default', workdir="~/source/firefox/src", pollInterval=604800)
# Webkit Poller
webkit_poller = GitPoller('https://git.webkit.org/git/WebKit-https.git', branch='master', worker="~/source/webkitgtk/src", pollInterval=604800)
#poller.agent.verbose=True
c['change_source'] = [chrome_poller, firefox_poller, webkit_poller]
####### SCHEDULERS ########
'''
Schedulers Type:
OS: Linux <SingleBranch and Force Schedulers>
1.) Chromium : night, debug, release
2.) Firefox: night, debug, release
3.) Webkit: night, debug, release
'''
s_chromium_night = schedulers.SingleBranchScheduler(name='chromium-night', change_filter=util.ChangeFilter(branch='master'), treeStableTimer=3600, builderNames=[ 'chromium-night' ])
fb_chromium_night = schedulers.ForceScheduler(name="force-chromium-night", builderNames=[ 'chromium-night' ])
s_chromium_release = schedulers.SingleBranchScheduler(name='chromium-release', change_filter=util.ChangeFilter(branch='master'), treeStableTimer=3600, builderNames=[ 'chromium-release' ])
fb_chromium_release = schedulers.ForceScheduler(name="force-chromium-release", builderNames=[ 'chromium-release' ])
s_chromium_debug = schedulers.SingleBranchScheduler(name='chromium-debug', change_filter=util.ChangeFilter(branch='master'), treeStableTimer=3600, builderNames=[ 'chromium-debug' ])
fb_chromium_debug = schedulers.ForceScheduler(name="force-chromium-debug", builderNames=[ 'chromium-debug' ])
s_firefox_night = schedulers.SingleBranchScheduler(name='firefox-night', change_filter=util.ChangeFilter(branch='master'), treeStableTimer=3600, builderNames=[ 'firefox-night' ])
fb_firefox_night = schedulers.ForceScheduler(name="force-firefox-night", builderNames=[ 'firefox-night' ])
s_firefox_release = schedulers.SingleBranchScheduler(name='firefox-release', change_filter=util.ChangeFilter(branch='master'), treeStableTimer=3600, builderNames=[ 'firefox-release' ])
fb_firefox_release = schedulers.ForceScheduler(name="force-firefox-release", builderNames=[ 'firefox-release' ])
s_firefox_debug = schedulers.SingleBranchScheduler(name='firefox-debug', change_filter=util.ChangeFilter(branch='master'), treeStableTimer=3600, builderNames=[ 'firefox-debug' ])
fb_firefox_debug = schedulers.ForceScheduler(name="force-firefox-debug", builderNames=[ 'firefox-debug' ])
s_webkit_night = schedulers.SingleBranchScheduler(name='webkit-night', change_filter=util.ChangeFilter(branch='master'), treeStableTimer=3600, builderNames=[ 'webkit-night' ])
fb_webkit_night = schedulers.ForceScheduler(name="force-webkit-night", builderNames=[ 'webkit-night' ])
s_webkit_release = schedulers.SingleBranchScheduler(name='webkit-release', change_filter=util.ChangeFilter(branch='master'), treeStableTimer=3600, builderNames=[ 'webkit-release' ])
fb_webkit_release = schedulers.ForceScheduler(name="force-webkit-release", builderNames=[ 'webkit-release' ])
s_webkit_debug = schedulers.SingleBranchScheduler(name='webkit-debug', change_filter=util.ChangeFilter(branch='master'), treeStableTimer=3600, builderNames=[ 'webkit-debug' ])
fb_webkit_debug = schedulers.ForceScheduler(name="force-webkit-debug", builderNames=[ 'webkit-debug' ])
c['schedulers'] = [ s_chromium_night, fb_chromium_night, s_chromium_release, fb_chromium_release, s_chromium_debug, fb_chromium_debug, s_firefox_night, fb_firefox_night, s_firefox_release,
fb_firefox_release, s_firefox_debug, fb_firefox_debug, s_webkit_night, fb_webkit_night, s_webkit_release, fb_webkit_release, s_webkit_debug, fb_webkit_debug ]
####### BUILDERS AND FACTORIES #########
'''
Builder_Factories Type:
OS: Linux
1.) Chromium : night, debug, release
2.) Firefox: night, debug, release
3.) Webkit: night, debug, release
'''
# Chromium
# 1. Chromium Nightly
chromium_nightly_factory = util.BuildFactory()
chromium_nightly_factory.workdir="/home/build-bot/source/chromium/src"
#chromium_nightly_factory.addStep(steps.ShellCommand(name ="Switching to chromium src", command=["cd", "/home/build-bot/source/chromium/src"],env={"PYTHONPATH": "."}, description="Switching to chromium src"))
chromium_nightly_factory.addStep(steps.ShellCommand(name ="Switching to chromium src", command=["pwd"], description="Switching to chromium src"))
chromium_nightly_factory.addStep(steps.ShellCommand(name ="Cleaning old builds", command=["rm", "-rf", "out"], description="Cleaning old builds"))
chromium_nightly_factory.addStep(steps.ShellCommand(name ="Cleaning old builds", command=["mkdir", "out"], description="Cleaning old builds"))
chromium_nightly_factory.addStep(steps.ShellCommand(name ="Updating the checkout", command=["git", "stash"], description="Updating the checkout"))
chromium_nightly_factory.addStep(steps.ShellCommand(name ="Updating the checkout", command=["git", "pull"], description="Updating the checkout"))
chromium_nightly_factory.addStep(steps.ShellCommand(name ="Updating the checkout", command=["git", "stash", "pop"], description="Updating the checkout"))
chromium_nightly_factory.addStep(steps.ShellCommand(name ="Set config", command=["gclient", "config" ,"https://chromium.googlesource.com/chromium/src.git"], description="Set config"))
#chromium_nightly_factory.addStep(steps.ShellCommand(name ="Resyncing and reupdating the hooks", command=["gclient", "sync"], description="Resyncing and reupdating the hooks"))
chromium_nightly_factory.addStep(steps.ShellCommand(name ="Run the hooks", command=["gclient", "runhooks"], description="Run the hooks"))
chromium_nightly_factory.addStep(steps.ShellCommand(name ="Setting up new build", command=["gn", "gen", "out/autobuild-1", "--args=is_debug=false"], description="Setting up new build"))
chromium_nightly_factory.addStep(steps.ShellCommand(name ="Build", command=["autoninja", "-v", "-C", "out/autobuild-1"], description="Build"))
chromium_nightly_factory.addStep(steps.ShellCommand(name ="Move the latest build to release directory", command="""mv out/autobuild-1 /home/build-bot/builds/chromium/autobuild-`date +%F`""", description="Copy the latest build to release directory"))
#chromium_nightly_factory.addStep(steps.ShellCommand(name ="Add build tag", command =["echo", "'Current Chromium Build $(date)'", ">", "/home/build-bot/builds/chromium/buildtag"], description ="Add build tag"))
# 2.Chromium Release
# chromium_release_factory = util.BuildFactory()
# chromium_release_factory.workdir="/home/build-bot/source/chromium/src"
# #chromium_release_factory.addStep(steps.ShellCommand(name ="Switching to chromium src", command=["cd", "/home/build-bot/source/chromium/src"],env={"PYTHONPATH": "."}, description="Switching to chromium src"))
# chromium_release_factory.addStep(steps.ShellCommand(name ="Switching to chromium src", command=["pwd"], description="Switching to chromium src"))
# chromium_release_factory.addStep(steps.ShellCommand(name ="Cleaning old builds", command=["rm", "-rf", "out"], description="Cleaning old builds"))
# chromium_release_factory.addStep(steps.ShellCommand(name ="Cleaning old builds", command=["mkdir", "out"], description="Cleaning old builds"))
# chromium_release_factory.addStep(steps.ShellCommand(name ="Updating the checkout", command=["git", "stash"], description="Updating the checkout"))
# chromium_release_factory.addStep(steps.ShellCommand(name ="Updating the checkout", command=["git", "pull"], description="Updating the checkout"))
# chromium_release_factory.addStep(steps.ShellCommand(name ="Updating the checkout", command=["git", "stash", "pop"], description="Updating the checkout"))
# chromium_release_factory.addStep(steps.ShellCommand(name ="Set config", command=["gclient", "config" ,"https://chromium.googlesource.com/chromium/src.git"], description="Set config"))
# #chromium_release_factory.addStep(steps.ShellCommand(name ="Resyncing and reupdating the hooks", command=["gclient", "sync"], description="Resyncing and reupdating the hooks"))
# chromium_release_factory.addStep(steps.ShellCommand(name ="Run the hooks", command=["gclient", "runhooks"], description="Run the hooks"))
# chromium_release_factory.addStep(steps.ShellCommand(name ="Setting up new build", command=["gn", "gen", "out/autobuild-1", "--args=is_debug=false"], description="Setting up new build"))
# chromium_release_factory.addStep(steps.ShellCommand(name ="Build", command=["autoninja", "-v", "-C", "out/autobuild-1"], description="Build"))
# chromium_release_factory.addStep(steps.ShellCommand(name ="Move the latest build to release directory", command="""mv out/autobuild-1 /home/build-bot/builds/chromium/autobuild-`date +%F`""", description="Copy the latest build to release directory"))
# #chromium_release_factory.addStep(steps.ShellCommand(name ="Add build tag", command =["echo", "'Current Chromium Build $(date)'", ">", "/home/build-bot/builds/chromium/buildtag"], description ="Add build tag"))
# 3. Chromium Debug
# chromium_debug_factory = util.BuildFactory()
# chromium_debug_factory.workdir="/home/build-bot/source/chromium/src"
# #chromium_debug_factory.addStep(steps.ShellCommand(name ="Switching to chromium src", command=["cd", "/home/build-bot/source/chromium/src"],env={"PYTHONPATH": "."}, description="Switching to chromium src"))
# chromium_debug_factory.addStep(steps.ShellCommand(name ="Switching to chromium src", command=["pwd"], description="Switching to chromium src"))
# chromium_debug_factory.addStep(steps.ShellCommand(name ="Cleaning old builds", command=["rm", "-rf", "out"], description="Cleaning old builds"))
# chromium_debug_factory.addStep(steps.ShellCommand(name ="Cleaning old builds", command=["mkdir", "out"], description="Cleaning old builds"))
# chromium_debug_factory.addStep(steps.ShellCommand(name ="Updating the checkout", command=["git", "stash"], description="Updating the checkout"))
# chromium_debug_factory.addStep(steps.ShellCommand(name ="Updating the checkout", command=["git", "pull"], description="Updating the checkout"))
# chromium_debug_factory.addStep(steps.ShellCommand(name ="Updating the checkout", command=["git", "stash", "pop"], description="Updating the checkout"))
# chromium_debug_factory.addStep(steps.ShellCommand(name ="Set config", command=["gclient", "config" ,"https://chromium.googlesource.com/chromium/src.git"], description="Set config"))
# #chromium_debug_factory.addStep(steps.ShellCommand(name ="Resyncing and reupdating the hooks", command=["gclient", "sync"], description="Resyncing and reupdating the hooks"))
# chromium_debug_factory.addStep(steps.ShellCommand(name ="Run the hooks", command=["gclient", "runhooks"], description="Run the hooks"))
# chromium_debug_factory.addStep(steps.ShellCommand(name ="Setting up new build", command=["gn", "gen", "out/autobuild-1", "--args=is_debug=false"], description="Setting up new build"))
# chromium_debug_factory.addStep(steps.ShellCommand(name ="Build", command=["autoninja", "-v", "-C", "out/autobuild-1"], description="Build"))
# chromium_debug_factory.addStep(steps.ShellCommand(name ="Move the latest build to release directory", command="""mv out/autobuild-1 /home/build-bot/builds/chromium/autobuild-`date +%F`""", description="Copy the latest build to release directory"))
# #chromium_debug_factory.addStep(steps.ShellCommand(name ="Add build tag", command =["echo", "'Current Chromium Build $(date)'", ">", "/home/build-bot/builds/chromium/buildtag"], description ="Add build tag"))
# Firefox
# 1. Firefox Nightly
firefox_nightly_factory = util.BuildFactory()
firefox_nightly_factory.workdir="/home/build-bot/source/firefox/src"
firefox_nightly_factory.addStep(steps.ShellCommand(name ="Switching to firefox src", command=["pwd"], description="Switching to firefox src"))
firefox_nightly_factory.addStep(steps.ShellCommand(name ="Cleaning old builds", command=["rm", "-rf", "obj-x86_64-pc-linux-gnu"], description="Cleaning old builds"))
firefox_nightly_factory.addStep(steps.ShellCommand(name="Updating the checkout", command =["hg", "pull", "-u"], description="Updating the checkout"))
firefox_nightly_factory.addStep(steps.ShellCommand(name="Bootstrap Setup [Runs as root]", command="""./mach bootstrap --application-choice='Firefox for Desktop Artifact Mode' --no-interactive --no-system-changes""", description="Bootstap Setup"))
firefox_nightly_factory.addStep(steps.ShellCommand(name="Building Firefox Desktop Artifact Mode", command ="""./mach build faster""", description="Building Firefox Desktop Artifact Mode"))
firefox_nightly_factory.addStep(steps.ShellCommand(name="Move the latest build to buildls directory", command="""mv obj-x86_64-pc-linux-gnu /home/build-bot/builds/firefox/autobuild-`date +%F`""", description="Copy the latest build to release directory"))
# 2. Firefox Release
# firefox_release_factory = util.BuildFactory()
# firefox_release_factory.workdir="/home/build-bot/source/firefox/src"
# firefox_release_factory.addStep(steps.ShellCommand(name ="Switching to firefox src", command=["pwd"], description="Switching to firefox src"))
# firefox_release_factory.addStep(steps.ShellCommand(name ="Cleaning old builds", command=["rm", "-rf", "obj-x86_64-pc-linux-gnu"], description="Cleaning old builds"))
# firefox_release_factory.addStep(steps.ShellCommand(name="Updating the checkout", command =["hg", "pull", "-u"], description="Updating the checkout"))
# firefox_release_factory.addStep(steps.ShellCommand(name="Bootstrap Setup [Runs as root]", command="""./mach bootstrap --application-choice='Firefox for Desktop Artifact Mode' --no-interactive --no-system-changes""", description="Bootstap Setup"))
# firefox_release_factory.addStep(steps.ShellCommand(name="Building Firefox Desktop Artifact Mode", command ="""./mach build faster""", description="Building Firefox Desktop Artifact Mode"))
# firefox_release_factory.addStep(steps.ShellCommand(name="Move the latest build to buildls directory", command="""mv obj-x86_64-pc-linux-gnu /home/build-bot/builds/firefox/autobuild-`date +%F`""", description="Copy the latest build to release directory"))
# 3. Firefox Debug
# firefox_debug_factory = util.BuildFactory()
# firefox_debug_factory.workdir="/home/build-bot/source/firefox/src"
# firefox_debug_factory.addStep(steps.ShellCommand(name ="Switching to firefox src", command=["pwd"], description="Switching to firefox src"))
# firefox_debug_factory.addStep(steps.ShellCommand(name ="Cleaning old builds", command=["rm", "-rf", "obj-x86_64-pc-linux-gnu"], description="Cleaning old builds"))
# firefox_debug_factory.addStep(steps.ShellCommand(name="Updating the checkout", command =["hg", "pull", "-u"], description="Updating the checkout"))
# firefox_debug_factory.addStep(steps.ShellCommand(name="Bootstrap Setup [Runs as root]", command="""./mach bootstrap --application-choice='Firefox for Desktop Artifact Mode' --no-interactive --no-system-changes""", description="Bootstap Setup"))
# firefox_debug_factory.addStep(steps.ShellCommand(name="Building Firefox Desktop Artifact Mode", command ="""./mach build faster""", description="Building Firefox Desktop Artifact Mode"))
# firefox_debug_factory.addStep(steps.ShellCommand(name="Move the latest build to buildls directory", command="""mv obj-x86_64-pc-linux-gnu /home/build-bot/builds/firefox/autobuild-`date +%F`""", description="Copy the latest build to release directory"))
# Webkit
# 1. Webkit Nightly
webkit_nightly_factory = util.BuildFactory()
# 2. Webkit Release
#webkit_release_factory = util.BuildFactory()
# 3. Webkit Debug
#webkit_debug_factory = util.BuildFactory()
c['builders'] = []
c['builders'].append(util.BuilderConfig(name="chromium-night", workernames=["chromium-night"], factory=chromium_nightly_factory))
#c['builders'].append(util.BuilderConfig(name="chromium-release", workernames=["chromium-rel"], factory=chromium_release_factory))
#c['builders'].append(util.BuilderConfig(name="chromium-debug", workernames=["chromium-deb"], factory=chromium_debug_factory))
c['builders'].append(util.BuilderConfig(name="firefox-night", workernames=["firefox-night"], factory=firefox_nightly_factory))
#c['builders'].append(util.BuilderConfig(name="firefox-release", workernames=["firefox-release"], factory=firefox_release_factory))
#c['builders'].append(util.BuilderConfig(name="firefox-debug", workernames=["firefox-debug"], factory=firefox_debug_factory))
#c['builders'].append(util.BuilderConfig(name="webkit-night", workernames=["webkit-night"], factory=webkit_nightly_factory))
#c['builders'].append(util.BuilderConfig(name="webkit-release", workernames=["webkit-rel"], factory=webkit_release_factory))
#c['builders'].append(util.BuilderConfig(name="webkit-debug", workernames=["webkit-deb"], factory=webkit_debug_factory))
####### BUILDBOT SERVICES #######
# Any IRC, SMTP, Notifiers
c['services'] = []
####### PROJECT IDENTITY ######
c['title'] = "Cloudfuzz Buildbot"
c['titleURL'] = "https://cloudfuzz.io"
# minimalistic config to activate new web UI
c['www'] = dict(port=8010, plugins=dict(waterfall_view={}, console_view={}, grid_view={}))
####### DB URL ######
c['db'] = {
'db_url' : "sqlite:///state.sqlite",
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment