-
Notifications
You must be signed in to change notification settings - Fork 0
/
master.cfg
158 lines (120 loc) · 7.35 KB
/
master.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# -*- python -*-
# ex: set syntax=python:
# 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 = {}
####### BUILDSLAVES
# The 'slaves' list defines the set of recognized buildslaves. Each element is
# a BuildSlave object, specifying a username and password. The same username and
# password must be configured on the slave.
from buildslaves import SLAVES
c['slaves'] = SLAVES
# 'slavePortnum' defines the TCP port to listen on for connections from slaves.
# This must match the value configured into the buildslaves (with their
# --master option)
c['slavePortnum'] = 9989
####### CHANGESOURCES
####### SCHEDULERS
c['schedulers'] = []
# The default scheduler - run unit tests and lint
from buildbot.scheduler import Scheduler
from buildbot.schedulers.timed import Nightly
from buildbot.schedulers.filter import ChangeFilter
c['schedulers'].append(Scheduler(name="Molly Continuous Integration",
change_filter=ChangeFilter(project='mollyproject', branch='master'),
treeStableTimer=600,
builderNames=["tester"]))
c['schedulers'].append(Scheduler(name="Molly Demo",
change_filter=ChangeFilter(project='mollyproject', branch='master'),
builderNames=["molly_demo"]))
c['schedulers'].append(Scheduler(name="Android Continuous Integration",
change_filter=ChangeFilter(project='mollyandroid', branch='master'),
builderNames=["android"]))
####### 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.
from buildbot.process.factory import BuildFactory
from buildbot.steps.source import Git
from buildbot.steps.shell import ShellCommand, WithProperties
from buildbot.steps.transfer import FileUpload, FileDownload, DirectoryUpload
from buildbot.steps.master import MasterShellCommand
from buildbot.config import BuilderConfig
c['builders'] = []
test_factory = BuildFactory()
test_factory.addStep(Git(repourl='git://github.com/mollyproject/mollyproject.git', mode='copy'))
test_factory.addStep(ShellCommand(command="pylint --ignore=wurfl_data.py --ignore=migrations --disable-msg F0401 -f html molly >pylint.html; true", description="analysing code"))
test_factory.addStep(FileUpload(slavesrc="pylint.html", masterdest="/srv/reports/pylint.html",mode=0644))
test_factory.addStep(ShellCommand(command=['python','setup.py','deploy','-s','/srv/mollydemo','-i','/srv/molly/'], description="deploying Molly"))
test_factory.addStep(ShellCommand(command=['figleaf','/srv/molly/mollydemo/manage.py','test','--noinput', 'places', 'search', 'library', 'podcasts'], description="running unit tests", env={'PYTHONPATH': '/srv/molly/lib/python2.6/site-packages/', 'NO_SOUTH': '1'}, timeout=14400))
test_factory.addStep(FileDownload(mastersrc="/srv/data/figleaf-exclude", slavedest="figleaf-exclude"))
test_factory.addStep(ShellCommand(command=['figleaf2html', '-x', 'figleaf-exclude'], description="analysing test coverage"))
test_factory.addStep(DirectoryUpload(slavesrc="html", masterdest="/srv/reports/test_coverage"))
test_factory.addStep(ShellCommand(command=['bash','full_doc_build.sh','/srv/docs','/srv/molly/bin/python'], workdir="build/docs/", description="generating documentation",
env={'PYTHONPATH': '/srv/molly/', 'DJANGO_SETTINGS_MODULE': 'mollydemo.settings'}))
c['builders'].append(
BuilderConfig(name="tester",
slavenames=["buildmaster"],
factory=test_factory))
deploy_factory = BuildFactory()
deploy_factory.addStep(Git(repourl='git://github.com/mollyproject/mollyproject.git', mode='copy'))
deploy_factory.addStep(ShellCommand(command=['python','setup.py','deploy','-s','/srv/mollydemo','-i','/srv/molly/'], description="deploying Molly", descriptionDone='deployed Molly'))
deploy_factory.addStep(ShellCommand(command=['touch','/srv/molly/mollydemo/apache/molly.wsgi'], description="restarting WSGI", descriptionDone='restarted WSGI'))
deploy_factory.addStep(ShellCommand(command=['python','scripts/smoke-test.py','http://localhost'], description="smoke testing Molly", descriptionDone='smoke tested Molly'))
c['builders'].append(
BuilderConfig(name="molly_demo",
slavenames=["molly_demo"],
factory=deploy_factory))
apk_factory = BuildFactory()
apk_factory.addStep(Git(repourl='git://github.com/mollyproject/mollyandroid.git', mode='copy'))
apk_factory.addStep(ShellCommand(command=['android','update','project','--path','.'], description="bootstrapping build", descriptionDone="bootstrapped build"))
apk_factory.addStep(ShellCommand(command=['ant','debug'], description="building", descriptionDone="built"))
apk_factory.addStep(FileUpload(slavesrc="bin/Splash-debug.apk", masterdest=WithProperties("/srv/apks/mollyandroid-debug-%(buildnumber)s-%(got_revision)s.apk"),mode=0644))
apk_factory.addStep(MasterShellCommand(command=['ln', '-sf', WithProperties("/srv/apks/mollyandroid-debug-%(buildnumber)s-%(got_revision)s.apk"), '/srv/apks/mollyandroid-debug-latest.apk'], description='updating latest APK symlink', descriptionDone='updated latest APK symlink'))
c['builders'].append(
BuilderConfig(name="android",
slavenames=["buildmaster"],
factory=apk_factory))
####### 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'] = []
# TODO: E-mail notifications
from buildbot.status import html
c['status'].append(html.WebStatus(
http_port=8010,
order_console_by_time=True,
revlink="https://github.com/mollyproject/mollyproject/commit/%s",
changecommentlink=(r'\b#(\d+)\b', r'https://github.com/mollyproject/mollyproject/issues/\1',
r'Ticket \g<0>'),
change_hook_dialects={ 'github' : True },
))
from buildbot.status import words
c['status'].append(words.IRC(host="irc.freenode.net", nick="MollyBuilder",
notify_events={
'exception': 1,
'successToFailure' : 1,
'failureToSuccess' : 1,
},
channels=["#molly"]))
####### PROJECT IDENTITY
# the 'projectName' string will be used to describe the project that this
# buildbot is working on. For example, it is used as the title of the
# waterfall HTML page. The 'projectURL' string will be used to provide a link
# from buildbot HTML pages to your project's home page.
c['projectName'] = "Molly"
c['projectURL'] = "http://mollyproject.org/"
# 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://buildmaster.mollyproject.org/"
####### DB URL
# This specifies what database buildbot uses to store change and scheduler
# state. You can leave this at its default for all but the largest
# installations.
c['db_url'] = "sqlite:///state.sqlite"