summaryrefslogtreecommitdiff
path: root/buildbot/master.cfg
blob: 688f05501019de7d9d7f657da6625d41d74b6625 (plain)
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
# -*- python -*-
# ex: set filetype=python:

from buildbot.plugins import *

# 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("lcov-worker", "lcov-pass"),
                worker.Worker("selenium-worker", "selenium-pass"),
                worker.Worker("doc-worker", "doc-pass"),
                worker.Worker("switcher-worker", "switcher-pass"),
                worker.Worker("wallet-worker", "wallet-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': 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(
        'git://taler.net/wallet-webex',
        workdir='gitpoller-workdir', branch='master',
        pollinterval=300))
c['change_source'].append(changes.GitPoller(
        'git://taler.net/merchant',
        workdir='gitpoller-workdir', branch='master',
        pollinterval=300))
c['change_source'].append(changes.GitPoller(
        'git://taler.net/exchange',
        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 'runtests' build

c['schedulers'] = []
c['schedulers'].append(schedulers.Periodic(name="periodic",
                                           builderNames=["doc-builder"],
                                           periodicBuildTimer=12*60*60))
c['schedulers'].append(schedulers.SingleBranchScheduler(
                            name="all",
                            change_filter=util.ChangeFilter(branch='master'),
                            treeStableTimer=None,
                            builderNames=["lcov-builder",
                                          "selenium-builder",
                                          "switcher-builder",
                                          "wallet-builder"]))
c['schedulers'].append(schedulers.ForceScheduler(
                            name="force",
                            builderNames=["lcov-builder",
                                          "selenium-builder",
                                          "switcher-builder",
                                          "doc-builder",
                                          "wallet-builder"]))

####### 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.

# FIXME: the bad side of these builders is that they expect the worker's environment
# to be _already_ set up (codedbases, scripts, etc).  In other words, it's not "self-contained".

from buildbot.steps.source.git import Git
from buildbot.steps.shell import ShellCommand

wallet_factory = util.BuildFactory()

wallet_factory.addStep(Git(repourl='git://git.taler.net/wallet-webex.git',
                           mode='full',
                           method='fresh',
                           alwaysUseLatest=True,
                           haltOnFailure=True,
                           branch='master'))

wallet_factory.addStep(ShellCommand(name="configuration",
                                    description="Running configure script",
                                    descriptionDone="Correctly configured",
                                    command=["./configure"],
                                    workdir="build/"))

wallet_factory.addStep(ShellCommand(name="test",
                                    description="Running wallet tests",
                                    descriptionDone="Test correctly run",
                                    command=["make", "check"],
                                    workdir="build/"))

lcov_factory = util.BuildFactory()

lcov_factory.addStep(Git(repourl='git://git.taler.net/deployment.git',
                         mode='full',
                         method='fresh',
                         alwaysUseLatest=True,
                         haltOnFailure=True,
                         branch='master'))
lcov_factory.addStep(ShellCommand(name="invalidation",
                                  description="Invalidating timestamps",
                                  descriptionDone="timestamps invalidated",
                                  command=["./invalidate.sh"], 
                                  workdir="build/taler-build"))
lcov_factory.addStep(ShellCommand(name="builder",
                                  description="Compiling..",
                                  descriptionDone="lcov files generated",
                                  command=["make", "lcov"], 
                                  workdir="build/taler-build",
                                  env={'PATH': "${HOME}/local/bin:${PATH}",
                                  'TALER_CHECKDB': "postgresql:///talercheck?host=/home/${USER}/sockets"}))

switcher_factory = util.BuildFactory()
switcher_factory.addStep(Git(repourl='git://git.taler.net/deployment.git',
                         mode='full',
                         method='fresh',
                         alwaysUseLatest=True,
                         haltOnFailure=True,
                         branch='master'))
switcher_factory.addStep(ShellCommand(name="build",
                                  description="Building inactive blue-green party.",
                                  descriptionDone="Compile.",
                                  command=["./build.sh"],
                                  workdir="build/buildbot"))
switcher_factory.addStep(ShellCommand(name="build",
                                  description="Starting inactive blue-green party.",
                                  descriptionDone="Restarting Taler.",
                                  command=["./restart.sh"],
                                  workdir="build/buildbot"))
switcher_factory.addStep(ShellCommand(name="build",
                                  description="Checking services are correctly restarted.",
                                  descriptionDone="All services are correctly restarted.",
                                  command=["./checks.sh"],
                                  workdir="build/buildbot"))
switcher_factory.addStep(ShellCommand(name="build",
                                  description="Switching active party.",
                                  descriptionDone="Active party has been switched.",
                                  command=["./switch.sh"],
                                  workdir="build/buildbot"))
selenium_factory = util.BuildFactory()
selenium_factory.addStep(ShellCommand(name="selenium",
                                      description="Headless browser test",
                                      descriptionDone="Test finished",
                                      command=["launch_selenium_test"],
                                      env={'PATH': "${HOME}/local/bin:/usr/lib/chromium:${PATH}"}))

# this factory builds {api,docs}.taler.net AND {www,stage}.taler.net
doc_factory = util.BuildFactory()

doc_factory.addStep(Git(repourl='git://git.taler.net/deployment.git',
                        mode='full',
                        method='fresh',
                        alwaysUseLatest=True,
                        haltOnFailure=True,
                        branch='master'))
doc_factory.addStep(ShellCommand(name="build docs",
                                 description="Building documentation.",
                                 descriptionDone="Documentation built.",
                                 command=["./update_docs.sh"],
                                 workdir="build/taler-build"))
doc_factory.addStep(ShellCommand(name="build docs",
                                 description="Building www.taler.net.",
                                 descriptionDone="www.taler.net built",
                                 command=["./update_www.sh"],
                                 workdir="build/taler-build"))
doc_factory.addStep(ShellCommand(name="build docs",
                                 description="Building stage.taler.net.",
                                 descriptionDone="stage.taler.net built",
                                 command=["./update_stage.sh"],
                                 workdir="build/taler-build"))

c['builders'] = []

c['builders'].append(
    util.BuilderConfig(name="lcov-builder",
      workernames=["lcov-worker"],
      factory=lcov_factory))

c['builders'].append(
    util.BuilderConfig(name="switcher-builder",
      workernames=["switcher-worker"],
      factory=switcher_factory))

c['builders'].append(
    util.BuilderConfig(name="selenium-builder",
      workernames=["selenium-worker"],
      factory=selenium_factory))

c['builders'].append(
    util.BuilderConfig(name="doc-builder",
      workernames=["doc-worker"],
      factory=doc_factory))

c['builders'].append(
    util.BuilderConfig(name="wallet-builder",
                       workernames=["wallet-worker"],
                       factory=wallet_factory))

####### 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'] = []

c['services'] = []

from buildbot.plugins import reporters
irc = reporters.IRC("irc.eu.freenode.net", "taler-bb",
                    useColors=False,
                    channels=[{"channel": "#taler"}],
                    password="taler-bb-pass19",
                    notify_events={
                    'exception': 1,
                    'successToFailure': 1,
                    'failureToSuccess': 1,
})
email = reporters.MailNotifier(fromaddr="testbuild@taler.net",
                               sendToInterestedUsers=False,
                               mode=("problem"),
                               builders=("switcher-builder",
                                         "doc-builder",
                                         "wallet-builder",
                                         "selenium-builder"),
                               extraRecipients=["buildfailures@taler.net"],
                               subject="Taler build.")
c['services'].append(irc)
c['services'].append(email)

####### PROJECT IDENTITY

# the 'title' string will appear at the top of this buildbot installation's
# home pages (linked to the 'titleURL').

c['title'] = "Taler"
c['titleURL'] = "https://taler.net"

# 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://buildbot.taler.net/"

# minimalistic config to activate new web UI
c['www'] = dict(port=8010,
                plugins=dict(waterfall_view={}, console_view={}),
                allowed_origins=["https://*.taler.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",
}